Exam 1 Flashcards
Integers
Int
5, 29, 1,356
Float
float
12.5, 6.9, 7.00
Strings
str
“Hellos World!”, “Apple”, “5”
Boolean
bool
True, False
Assignment Statements
Update the value in a variable
One equal sign
Equality Operations
Ask a question about values
Use two equal signs
Tracing
Track the value of variables over time
Write Comments
comment
Use other modules in Python programs
import module name
from module name import keyword
Membership
Check whether the first string is in the second string
“in” or “not”
Subscripting
Extract one or more characters from the string
print(message[0])
Subscript
variable or string literal[index #]
[#:#]
Name error
Try to reference a variable that doesn’t exist yet
Type error
Use an operator incorrectly
Ex. Adding a string & number
Syntax error
Broke Python’s rules of spelling, grammar, and punctuation
Functions
Reusable chucks of code that can be used to build up more complicated programs
Calling functions
How functions are used
(Name of function)