This data type stores a value.
A variable
The act of combining two or more strings and/or string variables.
Concatenation
A set of commands that may repeat or run more than once.
Loop
name = John"
name = "John"
Add a quote mark before John.
name = "John"
print(john)
print(name)
print the variable name
This data type has a decimal or fractional value.
Float
The command used to display text on the console.
Print Statement
A set of commands that runs top down.
Program
place = Boston
place = "Boston"
You must have quotes around strings.
place: "Ohio"
place = "Ohio"
Use an equal sign not a colon when defining a variable.
A whole number
Integer
In python this symbol, ______ , is used for division.
/
In python this symbol, ______ , is used for multiplication.
*
if x<50
color= "red"
if x<50:
You need a colon at the end of if statements.
turtle.foward(100)
turtle.forward(100)
Spelling of forward.
This data type is surrounded by " "
String
A line of code that does not effect the way the program runs. Each one of these begins with a #.
Comment
Each line of code entered is known as a _______.
Command
person= str("9")
person = int("9")
No need to cast a string into a string.
number = 9
float_num = flo(number)
number = 9
float_num = float(number)
Use the whole word float to cast a variable into a float.
This data type stores a value of either True or False.
Boolean
Where the text appears when you use a print statement.
Console
This symbol, _______, goes at the end if statements, events, loops, and other similar commands.
:
DISPLAY = pygame.display.set_mode(X,Y)
DISPLAY = pygame.display.set_mode([X,Y])
Include brackets around the x and y coordinates.
string1 = "I like to eat"
string2 = "donuts."
print(string1 + string2)
string1 = "I like to eat"
string2 = "donuts."
print(string1 + " " + string2)
Manually add spaces when concatenating string variables.