jeudi 7 septembre 2017

for letter in prefixes - how does letter work here? [duplicate]

This question already has an answer here:

I was doing exercise but for some reason it wasn't working

<a href="http://ift.tt/2f7t6fm">mine ducklings</a>

I found correct version on GitHub

<a href="http://ift.tt/2xRlmpp">MadCzarls ducklings</a> 

The only difference is in line with if statement
mine if letter == "O" or "Q":
working if letter == "O" or letter == "Q":
I was reading about for loop a little, for example here on python wiki but couldn't find an answer.

My question is why I have to write again "letter ==", and what exactly "letter" is? Because it is not a normal variable?

Aucun commentaire:

Enregistrer un commentaire