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))
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)
3
Q
A