Do Now 4.02
1. In your Console
Type the following code
for i in range(0, 10):
print(i)
In your Notebook
Respond to the following
Write down what the range function does.
2. In your Console
Type the following
Use the range and len functions to make a for loop that loops through a.
a = ['apples', 'oranges', 'pears', 'grapes']
len_a = len(a)
range(0, len(a))
Continue In your Notebook
- Write down what
range(0, len(a))does. - What is the return value of the range function?
3. In your Console
Use the range and len functions to make a for loop. (Remember that for loops iterate over lists)