Formulas Flashcards

1
Q

Using enumerate() for Indexing: To access both the index and the value of each item in a list, you used enumerate(). It modifies the loop to produce index-value pairs:

A

for index, area in enumerate(areas):

print(“room “ + str(index) + “: “ + str(area))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Basic for Loop Structure: iterates over a list using a simple ‘for loop’, printing each element

A

for height in fam:

print(height)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly