Python list knowledge check
Full name (with capitals)
How do you assign a list to a variable?
my_list = (apple pear banana cockroach)
my_list = (apple, pear, banana, cockroach)
my_list = "apple" "pear" "banana" "cockroach"
my_list = ["apple", "pear", "banana", "cockroach"]
my_list = [apple, pear, banana, cockroach]
my_list = [apple pear banana cockroach]
Which Python statement would be most useful in printing out your list (my_list) item by item?
for item in my_list
for item in range(0,3)
for item in range(1,4):
for item in mylist:
for item in my_list:
What would you use to print out the number of items in my_list?
How would I print the third item in my_list?
What would be the output from this program?
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google.
Terms of Service