Review Flashcards
math operators
Exponentiation (**) Multiplication (*) division (/ and //) remainder (%) Addition (+) and subtraction (-)
and
false and false = false
false and true = false
true and false = false
true and true = true
or
false and false = false
false and true = true
true and false = true
true and true = true
end
end=’delimiter’ causes print to place delimiter (space) at end of data instead of newline character
space at the end, new line
sep
sep=’delimiter’ causes print to use delimiter (space) as item separator
apace in the middle
input function
Built-in input function reads input from keyboard
•Returns the data as a string
•Format: variable = input(prompt)
•prompt is typically a string instructing user to enter a value
Boolean is always T or F?
T
usage of if/else
multiple conditions are being used
usage of loop
reduce number of code
inner loop
always indented, always get executed to the outer loop
range functions
–
convert to float
a=123.99
trick question, its already a float
and/or/not
–
iteration
ex: (#,#,#)
first number is where you start
second number is where you end (dont include)
third number is what you count by
example:
for num in range (4)
0,1,2,3