for i in range(0, 10):
print(i)
Write down what the range function does.
a_list = ['apple', 'orange', 'pear', 'strawberry', 'grape']
print(len(a_list))
print(list(range(0, len(a_list)))
Write down what range(0, len(a_list))
does.
Use the range
and len
functions to make a for
loop that prints the elements of a_list
, one at a time.