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
Serggg [28]
3 years ago
9

(Reverse number) Write a program that prompts the user to enter a four-digit inte- ger and displays the number in reverse order.

Here is a sample run:
Computers and Technology
1 answer:
prohojiy [21]3 years ago
6 0

Answer:

The program in Python is as follows:

num = int(input("4 digit number: "))

numstr = str(num)

if(len(numstr)!=4):

    print("Number must be 4 digits")

else:

    numstr = numstr[::-1]

    num = int(numstr)

    print(num)

Explanation:

This prompts user for input

num = int(input("4 digit number: "))

This converts the input number to string

numstr = str(num)

This checks if number of digits is or not 4

if(len(numstr)!=4):

If not, the following message is printed

    print("Number must be 4 digits")

else:

If digits is 4,

This reverses the string

    numstr = numstr[::-1]

This converts the reversed string to integer

    num = int(numstr)

This prints the reversed number

    print(num)

You might be interested in
प्रश्न-20 उचित स्थान पर विराम चिह्न लगाइए
prohojiy [21]

Answer: HIND TOENGLISH TRANSALATION

Explanation:  Question-20 Put punctuation marks at the appropriate place

a) Kamal you are truly extraordinary

b) Subhash Chandra Bose said you give me blood, I will give you freedom

c) Are you Mr. Pravesh Verma

d) In every society there are all kinds of people good and bad, poor and rich, small and big.

e) Friends, now the time has come to die on the country.

3 0
3 years ago
Your mother is sure that you were driving too fast because she knows
Klio2033 [76]

I think the corret answer would be C

5 0
3 years ago
Read 2 more answers
Five varieties of software​
Georgia [21]

Answer:

accounting software

project management software

time tracking software

communication software

product pricing software

Explanation:

8 0
3 years ago
The formula A$7+$D7in cell was copied to cell H10.write the formula as it would appear in cell H10
vitfil [10]

Answer:

H$7+$D10

Explanation:

$ means fixed. It won't change.

6 0
3 years ago
Select three nonrenewable types of energy.
trapecia [35]

Answer:

nuclear, coal,petroleum

6 0
3 years ago
Other questions:
  • Yeah i just purchase a new laptop with built-in 802.11 wireless and bluetooth capabilities when you boot into windows you do not
    12·1 answer
  • How many bones are in a human body
    7·2 answers
  • Dr. Laos gets a referral for a 6 month old who has become listless and stopped eating lately. Her pediatrician wanted her to be
    15·1 answer
  • In order to install a device, the operating system needs the required __________ for that device.
    15·2 answers
  • Which of the following are activities that today’s companies would perform?
    5·1 answer
  • Which of the following is NOT a font style? Color Bold Italic Regular
    10·2 answers
  • Provide TWO reasons to explain why humans and animals need clean wat​
    9·2 answers
  • Dealing with stress and strong emotions centeral idea​
    6·2 answers
  • It displays the contents of the active cell. It allows you to enter and edit data, such as formulas.
    8·1 answer
  • SmartArt is a Microsoft Office tool for creating what?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!