0

for loop

There is an example program in the app: words = ["Hello", "world", "spam", "eggs"] for word in words: print ('word'+'!') What i dont get: how does python comprehend plural? I replaced 'word(s)' for example with 'poop(s)' and it still works...

3rd Jan 2017, 12:40 PM
miseducation
2 Antworten
+ 8
~_~ (seriously? go study!)
3rd Jan 2017, 12:48 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 1
it's not plural that's the name of your variable wich contains hello,world... shit = ["hello", "world", "spam", "eggs"] for bull in shit: print(bull + "!") still working
3rd Jan 2017, 12:53 PM
Leonida17st
Leonida17st - avatar