0
please can anyone help me to understand this code by simple way ?
words = ["hello", "world", "spam", "eggs"] counter = 0 max_index = len(words) - 1 while counter <= max_index: word = words[counter] print(word + "!") counter = counter + 1 Try It Yourself Result: >>> hello! world! spam! eggs! >>>
3 Antworten
+ 2
This is very simple and here you go: words is a list and using while loop you are iterating that list and printing one value at a time. That's it.
0
thank so much
0
😂😂 you stuck where was I , when i started.. i suggest you to write this on paper then consider the every word, you will then understand it more easily..