1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
AleksandrR [38]
3 years ago
12

Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending whe

n the user enters "Quit", "quit", or "q" for the line of text.
Computers and Technology
1 answer:
dalvyx [7]3 years ago
7 0

Answer:

string=""

while string not in {"Quit","quit","q"}:

   string=input("Enter line to be reversed")   #line of text will be entered

   if string!="Quit" and string!="quit" and string!="q":    #If quit is not  entered

       print("Reverse of line is : ")

       print(string[::-1])

OUTPUT :

Enter line to be reversedThis code is in python language

Reverse of line is :  

egaugnal nohtyp ni si edoc sihT

Enter line to be reversedHello world

Reverse of line is :  

dlrow olleH

Enter line to be reversedquit

Explanation:In the above program, First a while loop is executed and checked if line of text is not 'quit', 'Quit' or 'q'. If condition is true, then loop is executed and in python any string or list can be traversed from end if step is given -1. Similarly line of text is accessed from the last element. If quit is entered, then the program will be broken out of the loop.

You might be interested in
What is parallelism of microinstruction
Kitty [74]
The answer is Hardware level works upon dynamic parallelism whereas, the software level works on static parallelism. Dynamic parallelism means the processor decides at run time which instructions to execute in parallel,
8 0
3 years ago
Witch of the following is a valid why a scientist might a scientific theory
ad-work [718]

c i think because i new piece of info came in which changes peoples theorys

7 0
3 years ago
If you know about 3D printers could you help me fix mine?
Yuki888 [10]

Answer:

you have to let the 3D printer cool off for 15 minutes before turning it back on. once you turned it back on and then you can test the filament and after that it should start working.

Explanation:

so don't touch it for 15 minutes and just leave it alone . if it doesn't work in 15 minutes and leave it for 24 hours completely off and no one touches it.

3 0
3 years ago
Question 1 (True/False Worth 3 points)
ANTONII [103]
False because the internet connects with multiple communication networks to exchange information
6 0
2 years ago
Virus warning don’t go on bit l y links it’s a virus
Alinara [238K]

Answer:

tysm

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which feature of the Excel window should I use to perform an action
    11·1 answer
  • Software referd to the physical parts of the computer True or False
    9·2 answers
  • What is a mortgage?
    8·2 answers
  • David has created a lot of styles and now his Quick Style Gallery contains styles he no longer uses.
    14·2 answers
  • After which stage in the information processing cycle can data be referred for future use?
    7·1 answer
  • What is the output of 1101 x 10 == 11000 + 10?
    12·1 answer
  • Is anyone really good at immerse 2 learn??
    9·1 answer
  • Write a function in Java that implements the following logic: Given a string and an int n, return a string made of n repetitions
    15·1 answer
  • STM-1 contains 63 primary 2-Mbps data streams and each of them contains 30 time slots for speech.
    14·1 answer
  • Question 4 of 25
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!