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]
2 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]2 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
According to Manny experts how often show files be backed up
timama [110]
They should be backed up every single day as loss of data could mess up certain machines
5 0
2 years ago
What are the advantages and disadvantages of solving a problem that can be broken down into repetitive tasks with recursion as o
lesantik [10]

Answer:

Answered below

Explanation:

Recursion refers to the process of a function calling itself within its own definition. It calls itself repeatedly until a base condition is met and the loop breaks.

The advantages of recursion over loops include;

A) Recursion reduces time complexity.

B) Recursion is better at tree traversal and graphs.

C) Recursion reduces the time needed to write and debug code and also adds clarity to code.

Disadvantages of recursion include;

A) Recursion uses more memory because each function call remains in stack until the base case is met.

B) Recursion can be slow.

C) Recursion

3 0
3 years ago
Including a space in the file name does not cause problems on any operating system
castortr0y [4]

Your answer is false

Because adding a space in a file name corrupts the file name created for that file so if you were to add a space that would ruin it

8 0
2 years ago
Read 2 more answers
If AX contains hex information 2111 and BX contains hex information 4333, what is the content in BX in hex format after performi
il63 [147K]

Answer:

BX will hold 6444 in hex format.

Explanation:

From the given information:

We need to understand that AX is 64-bit hex number.

When performing ASM instruction (Assembly language instruction),

The addition of 2111 + 4333 = 6444 will be in BX.

This is because ADD, BX, AX will add bx and ax; and the final outcome will be stored in BX.

∴

BX will hold 6444 in hex format.

7 0
2 years ago
If a movie starts at 305 and the movie is 2 hrs and 44 mins when does the movie end?
AURORKA [14]
3 : 05 + 2 : 44 = 5 : 49 

.......................................  
4 0
2 years ago
Other questions:
  • In file hashing, a file is read by a special algorithm that uses the value of the bits in the file to compute a single number ca
    13·1 answer
  • Which Numpy function do you use to create an array? (Points : 1) np
    5·1 answer
  • What does FLUX do when soldering an electrical joint?
    13·2 answers
  • What is human data,
    8·1 answer
  • A desperate employee calls because she has accidentally deleted crucial files from her hard drive and can’t retrieve them from t
    13·1 answer
  • A car manufacturer uses'simulation software during the design process for a new car. Which of the
    9·1 answer
  • When hacking a website to test a secure connection and ensure internet safety, what is a good way to check the coding of the web
    14·1 answer
  • What is the function of a CPU? simple words:D
    15·2 answers
  • PLEASE HELP!!! 18 points
    5·1 answer
  • ¿Es lo mismo hablar de tecnología que de computadora?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!