- 4
Fill in the blanks to iterate over the list using a far loop and print it's values. list=[1,2,3] , _ var_list: , print(_)
2 Antworten
+ 2
list = [1, 2, 3]
for var in list:
print(var)
+ 1
I see you changed your question, so I shall now intervene. This looks like a challenge question or something from sololearn.
list = [1, 2, 3]
for var in list:
print(var)
The var simply is a variable that will be used when it shifts through each number inside the list. So the first time it loops, var becomes 1, then 2, and then 3.
The best way to look at a for loop, is to say: For each value in the list
If you're ever stuck on any of those tutorial questions, just go back and reread the examples, it doesn't penalize you. We can surely help and have no problem doing so, but be sure to practice, otherwise you won't be able to properly do it yourself. ^^