All right, you learnt how to use a for loop to iterate through a list.
Sometimes though you might want to, you might have to iterate through two lists at the same time,
so let's say you have two lists. A list with three items so here you have
some names say James, John, and Jack. Pretty creative here and you also have
another list let's say email domains which also has three items as Gmail
Hotmail and Yahoo. If you'd like to apply the same operation to the items of both
lists you'd use the for loop in a slightly different way, so everything
starts with the for keyword and here you'd have to pass two variables.
Let's say the variable I and the variable J. So for I comma J in and you'd use the zip
function here and there is where you put the names of your list.
Email domains. That's it. Here is where you write your actions, your operations what
you want to do with the variable I and J. Let's try to print them out first before
we do something more creative, so this is how you print two variables at the same time.
Click Save. Go to your online, place Script7.
And so you get both the items of the first list and the items of the second list.
So that's how you use the for loop for iterating in more than one list.
So let's move on.