![timijebs](/avatars/2906.jpg)
timijebs
04.01.2021 •
Computers and Technology
Python exercise grade 10
Write a program that displays a number with its digit reversed. Generalize the program so that
the number can be one, two, or three digits. The program stops when users enters 0
Enter a number: 123
The reversed digit is: 321
Enter a number: 1
The reversed digit is: 1
Enter a number: 34
The reversed digit is: 43
Enter a number: 0
Solved
Show answers
More tips
- F Food and Cooking How to Cook a Steak with Mustard Sauce? What Kind of Meat to Choose?...
- P Photography and Videography What is lens calibration and why is it needed?...
- F Family and Home Stay Warm but Don t Overheat: What is the Optimal Temperature for Your Home During Winter?...
- H Health and Medicine How to Treat the Flu: A Comprehensive Guide...
- O Other What is a Disk Emulsifier and How Does it Work?...
- F Family and Home What does a newborn need?...
- F Family and Home Choosing the Right Car Seat for Your Child: Tips and Recommendations...
- F Food and Cooking How to Get Reconfirmation of Registration?...
- C Computers and Internet How to Get Rid of Spam in ICQ?...
- A Art and Culture Who Said The Less We Love a Woman, the More She Likes Us ?...
Answers on questions: Computers and Technology
- C Computers and Technology Tanya wants to create an sql query to fetch records from a table. which is the first word she has to type to write the query? a. from b. select c. where d. list...
- C Computers and Technology When does a scatterplot show a correlation...
- C Computers and Technology Which program is commonly used to verify a new piece of hardware?...
- M Mathematics Un motociclista viaja a 80 Km/h en línea recta, y acelera durante 5 seg hasta llegar a los 100 Km/h. Calcule la aceleración de la moto. En este problema, Que fórmula...
- E English Describe a fight between two of your classmates and to your class teacher...
- M Mathematics 6 cm 4 cm 2 cm 3 cm What is the area of the polygon?...
- M Mathematics Is amrican house wife over...
- C Chemistry 1. Tevin states that our solar system formed from a collision and fusion of comets and asteroids. Do you agree or disagree with Tevin s statement?...
- B Biology Two parents, one Blood type AO and the other BO, want to find the chance they ll have an O blood type offspring (rarest blood type)...
- M Mathematics Which of the following inequalities matches the graph?...
Ответ:
while True:
num = int(input("Enter a number: "))
if num == 0:
break
first = num // 100
second = (num // 10) - (first * 10)
third = (num - (first * 100)) - (second * 10)
reversed_digit = (third * 100) + (second * 10) + first
if 9 < num < 100:
reversed_digit = reversed_digit // 10
elif num < 10:
reversed_digit = reversed_digit//100
print("The reversed digit is:",reversed_digit)
I wrote my code in python 3.8. I hope this helps.
Ответ:
I cant see the image
Explanation:
So idk what you need help on sorry :(