Commands Flashcards
What is the first basic command?
Print (with bracets) “no = sign”
what are conditionals?
“IF” statements
What are the numeric expressions?
Addition +
Subtraction -
Multiplication *
Division /
Power **
Remainder %
What is the operator precedence? Order of operations.
Parenthesis
Power
Multiplication
Addition
Left to Right
What are floating point numbers?
Numbers with decimal parts.
what is a value?
a letter or a number
what is a string?
a string of words and are enclosed in quotation marks and brackets
what is “str”?
string
what is “int”?
integer
what do decimals belong to?
float
what is a variable?
Creating essentially a box that the program will go back to to retrieve information.
THIS IS A VARIABLE
eggs = 2
banana = 1
salad = 10
steak_and_rice = 30
print (“breakfast cost:”)
print (eggs + banana)
print (“lunch:”)
print (salad)
print (“dinner:”)
print (steak_eggs_rice + salad)
what is an assignment statement?
creates new variables and gives them values
what is a script?
a sequence of statements
How do you not repeat yourself?
Use a variable