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

what is the expression of The product of 4 and a number , then increased by 8.
The quotient of a number y and 22?
which of the following statements about sexual attaration and intimacy in the work place is true?1.romance between a worker and a supervisor must allways be out
a football team gained 9 yards on one play and then lost 22 yards on the next. Write a sum of integers to find the overall change in Field position.
A 15% tip represents the ratio 15 cents to 100 cents. Why does this make 15% a unit-less factor?
The sum of three consecutive even number is 156 what is the smallest of the three number?
A 15% tip represents the ratio 15 cents to 100 cents. Why does this make 15% a unit-less factor?
How do you solve 7x-5=30?
What latitudes are most likely to see glaciers??    A. 10° N and 10°S  B. 30°N and 30°S  C. 45°N  and 45°S  D. 90°N  and 90°SAnswers PLEASE???
80 is 40% of what number?