-
What are the four types of expressions?
literals, variables, calculations with operators and function calls
-
What is the name of the function used to get a value from the user?
input
-
Where does the loop variable in a
for
loop get its values?
from the list following the keyword in
-
When does a
while loop stop running?
when the expression after while
becomes false
-
How many arguments does the
range
function take?
one, two or three
-
What arguments would you give
range
to get the odd numbers from 1 to 5?
1,6,2
-
Write the header for the function work that takes
parameters min and max.
def work(min,max):
-
What statement allows a function to return a value to the function call.
return statement
-
Write the Python statement to create a file object for reading on the file
students.csv
file = open("students.csv", "r")
-
Write a
for
loop that uses the file object file
to print the lines in that file.
for line in file:
print(line)