What function opens a file in Python?
open()
What keyword initializes a function?
def
What keyword is used to run something only if a condition is met?
if statment
What symbols initialize a list?
What method reads the entire file as one string?
read()
What do you call the values you pass to a function?
parameters/arguments
What keyword checks another condition if the first fails?
elif
How do you access the first element of a list called mylist?
mylist[0]
What do you use to read a file line by line?
for loop
What keyword is used for when you want a function to give back a value internally?
return
What keyword runs if all others fail?
else
What method adds an item or value to the end of a list?
apend()
What mode should you use to open a file for reading?
"r"
What are the 4 most important parts of an initializing line of a function?
def, function name, parenthesis, colon
What is the syntax to check if x is greater than 5?
if x>5:
What function returns the length of a list?
len()
What does .strip() do?
Takes out all of the white space in a line.
What is the minimum number of parameters needed to initialize a function?
None
What keyword combines multiple conditions?
"or", "and"
What types of data values can a list hold? Name all common ones. Hint: there are four.
Integer, String, Float, Boolean