-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExercise3.py
More file actions
43 lines (20 loc) · 796 Bytes
/
Exercise3.py
File metadata and controls
43 lines (20 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#for/while loop problem - (Hint use both)
# Write a program that takes in a line of text as input, and outputs that line of text in reverse.
# The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text.
# Ex: If the input is:
# Hello there
# Hey
# quit
# then the output is:
# ereht olleH
# yeH
#Try this yourself! if you are stuck, the solution is commented on line 35
#to uncomment, highlight the code and press Ctrl + k + u (only works for visual studio code)
# #Solution
# user_text = input()
# while(user_text != 'Quit' and user_text != 'quit' and user_text != 'q'):
# rev = list(reversed(user_text))
# for i in rev:
# print(i, end="")
# print()
# user_text = input()