Answer to Question #301252 in Python for max

Question #301252

Write a loop that inputs words until the user enters STOP. After each input, the program should number each entry and print in this format:


1
Expert's answer
2022-02-23T00:10:45-0500
'''
    Write a loop that inputs words until the user enters STOP.
    After each input, the program should number each entry and print in this format:
'''


s=""
words=[]
n=1
while(s!="STOP"):
    t = "Enter word no. "+str(n)+": "
    s = input(t)
    if(s!="STOP"):
        words.append(s)
        n=n+1
print("\n")
n=1
for r in words:
    print("Words No. ",n,": ",r)
    n=n+1

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog