mtl1212
September 7, 2020, 2:18am
#1
Hello,
On Step#1, “Conditional Statements”, Mission #9 , for the for loop, instead of typing “for rows in apps_data” it is now “for apps in apps_data.” I’m confused as to why we swtiched (i.e., rows to apps). What is apps?
2 Likes
Hello @mtl1212 ,
These are some similar answer of your question
Hi @steven.prete ,
Both app and row are names we use to temporarily store the value in each iteration. Just like we can name a variable anything we want, we can use a different name here instead of app or row. I believe this post will clarify it:
Best,
Sahil
And
What’s referred to as <iterator> in Mary’s topic is just a variable, which holds the value of each item in the iterable as the for loop goes through it. When the for loop executes, it assigns the value of an item from the iterable, to a variable named <iterable>.
When you make a variable assignment:
my_var = "Hello!"
the computer stores the value "Hello!" somewhere, with the “name” my_var, and when you refer later to my_var, it knows to retrieve that specific value. When a for loop executes:
…
2 Likes
mtl1212
September 7, 2020, 6:54pm
#3
Hi @DishinGoyani . Thanks for the reply. They helped tremendously. Back to studying!