+ 3
I do not understand Question 6
filling in the blank: list [1,2,3,4,5] for var in list: print(var). Where this var came from?
4 Antworten
+ 5
var is name of variable which will store the element of your list.
Like when your for loop will run for first time than in var 1 will get stored and printed than loop will get executed second time than in var 2 will get stored and printed. This continues till the all elements in your list are printed.
Var is a name of variable here.
Hope you got it.
+ 1
Thanks. I understand. It comes at that point itself.
+ 1
Also var is not a reserved word in Python like in some other languages and can be used as a variable name.