Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started