Question: Assume the following code: numbers = [ 1 , 2 , 3 , 4 ] for number in numbers: print ( number ) Why was
Assume the following code:
numbers
for number in numbers:
printnumber
Why was the iteration variable called number?
Python mandates that the iteration variable must be called number.
Using number causes the program to run faster.
You will get an error if any other variable name is used.
Because the list is called numbers, the iteration variable should be called number.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
