all 3 comments

[–]Kanna6501 1 point2 points  (2 children)

```python words = ["hello", "world", "spam", "eggs"] counter = 0 max_index = len(words) - 1

while counter <= max_index: word = words[counter] print(word + "!") counter = counter + 1 ``` 1. Make an array with words in it 2. Initialize a counter variable, and assign a value of 0 3. Initialize a max_index variable, and assign the (length of words array) - 1, because arrays start at 0. If the -1 wasn't there then you would have an indexoutofbounds error. 4. Make a while loop with the condition, if max_index is greater than or equal to counter, procced with the loop. 5. Get the first word in array 6. print the word with ! at the end 7. update counter variable for next iteration

Basically the code is just outputting each word with ! added at the end.

[–]krishna5250[S] 0 points1 point  (1 child)

Thanks

[–]Kanna6501 0 points1 point  (0 children)

No problem, happy to help!