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
If you have machines doing jobs, fewer staff are needed, therefore costs are
elena55 [62]
If you have machines doing jobs, fewer staff is needed, therefore the costs are LESS.

Hope I helped!
4 0
3 years ago
Read 2 more answers
Double clicking the top right corner of a document will
Novosadov [1.4K]

Answer:

open the header. hope this helps

8 0
2 years ago
An effective team would never have​
MA_775_DIABLO [31]

Answer:

problems or struggles

Explanation:

i believe this because with an effective team most problems aren't there and you can understand and work out problems or struggles

4 0
3 years ago
Write a sub-program to display the acceleration of car. The program should ask initial velocity, final velocity, and time taken
LekaFEV [45]

Explanation:

If your asking the program in modular programming of Q-Basic & in sub procedure then here it is.

I hope it will help you..

<em>-</em><em> </em><em>Regards</em><em> </em><em>Rishab</em><em>.</em><em>.</em>

8 0
2 years ago
How do I type fast?<br><br> Give me an actual answer...
Ugo [173]
Practice!
And a good keyboard I recommend mechanical key boards
But the best way to improving your WPM is definitely practice one way you can practice is playing typeracer it’s pretty fun way

Hope this helps!
Brainliest is much appreciated!
7 0
2 years ago
Read 2 more answers
Other questions:
  • Both the USB flash drive and the DVD are data storage devices, but they both have numerous differences. Both can contain insane
    6·1 answer
  • An anthropologist may try to learn why and how a culture develops.<br><br> A.true<br> B.false
    13·1 answer
  • Adult learners understand a topic best by doing it. It gives them both new skills and confidence in their ability to carryout th
    6·1 answer
  • Technology offers a variety of rich opportunities available to teachers and students. According to Inan and Lowther (2010), ther
    6·1 answer
  • After you post a video of yourself defacing school property You can likely expect that
    11·2 answers
  • What is the IEEE 802 standards name for a wireless network that is limited to one person's workspace?
    14·1 answer
  • In troubleshooting a boot problem, what is the advantage of restoring all BIOS settings to their default values?
    6·1 answer
  • Tech A states that modern vehicles use asbestos as the brake material. Tech B states that asbestos is no longer used in brakes.
    8·1 answer
  • According to Chargaff's data, ________ must pair with ________, and ________ must pair with ________.
    8·1 answer
  • What represents a user’s specific preferences?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!