Question: I wrote this PYTHON program that asks the user for a certain number of words, then has them input the words, and at the end,

I wrote this PYTHON program that asks the user for a certain number of words, then has them input the words, and at the end, display the words in reverse order. However, it is supposed to only print the words at the end of the loop but mine prints them after every input, so I need help figuring out how to only display the words in reverse order at the end of the program.

# ask user for how many words num = int(input("how many words? > ")) s = '' # format the output and ask for the words for i in range (num,0,-1): i = str(input("word please! >")) s = i + s print(s)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets look at the problem description and your code The issue is that the program is printing the wor... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!