Reading Files
Functions
Conditionals
Lists
100

What function opens a file in Python?

open()

100

What keyword initializes a function?

def

100

What keyword is used to run something only if a condition is met?

if statment

100

What symbols initialize a list?

[]
200

What method reads the entire file as one string?

read()

200

What do you call the values you pass to a function?

parameters/arguments

200

What keyword checks another condition if the first fails?

elif

200

How do you access the first element of a list called mylist?

mylist[0]

300

What do you use to read a file line by line?

for loop

300

What keyword is used for when you want a function to give back a value internally?

return

300

What keyword runs if all others fail?

else

300

What method adds an item or value to the end of a list?

apend()

400

What mode should you use to open a file for reading?

"r"

400

What are the 4 most important parts of an initializing line of a function?

def, function name, parenthesis, colon

400

What is the syntax to check if x is greater than 5?

if x>5:

400

What function returns the length of a list?

len()

500

What does .strip() do?

Takes out all of the white space in a line.

500

What is the minimum number of parameters needed to initialize a function?

None

500

What keyword combines multiple conditions?

"or", "and"

500

What types of data values can a list hold? Name all common ones. Hint: there are four.

Integer, String, Float, Boolean

M
e
n
u