Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions