akasa899
akasa899 akasa899
  • 17-12-2020
  • Computers and Technology
contestada

i need help on what im doing wrong

i need help on what im doing wrong class=

Respuesta :

GrandNecro
GrandNecro GrandNecro
  • 17-12-2020

Answer:

The error is that you're trying to convert a string with letters inside into an int. What happens if a user type in 'a' instead of '1'? 'a' is not a number so the int('a') would fail and give you an error. Make you add a line to check whether the input a number or not.

Explanation:

Change your code to

DEorAP  = input("Is it AP or DE?")

if DEorAP.isdigit()

  DEorAP = int(DEorAP)

Answer Link

Otras preguntas

The cascading vaults of joern utzon s sidney opera houseare intended to suggest ____.
TRUE OR FALSE!!it is possible for a system of linear equations to have no solution
Laws were established to create an official system of slavery in the American colonies beginning in the
How do i do this if 4! = 4 x 3 x 2 x 1, then 8! equals?
What empire that lasted about three hundred years in india?
rob has a page with 25 stickers. he bought 13 of the stickers his mom bought him the rest of the stickers how many stickers did robs mom buy him
how many countries did nazi germany beat in ww2
What is happening to the temperature/pressure during the Deposition Change of State?
A ball is rolled uphill a distance of 9 meters before it slows, stops, and begins to roll back. The ball rolls downhill 22 meters before coming to rest against
All of the following resources are found in large quantities in the middle east except __________. a. coal b. gold c. natural gas d. petroleum