“For” loops

--Originally published at Luis Santana's Blog

What’s up lads! It’s been a while since my last post but that will change during this day, because I’ll do in a single day all the posts I didn’t finish in this partial hehe so brace yourselves.

 

635656667301311336741304865_resized_winter-is-coming-meme-generator-brace-yourselves-finals-are-coming-45e03b
Here’s the link

 

So, this post is dedicated to “for” loops, this loop is an iterator based for loop. It steps through the items of lists, tuples, strings, the keys of dictionaries and other iterables. The Python for loop starts with the keyword “for” followed by an arbitrary variable name, which will hold the values of the following sequence object, which is stepped through.

Here’s an example of “for” loops:

for

In this example the “for” loops work fine because you know exactly the amount of teams you have and won’t repeat infinitely.

You can check this link with examples, it helped me a lot