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

WILL GIVE BRAINLIST PLZ HELP SOMEONE!!! Martha is braiding a necklace for her friend. The graph below shows the length of the necklace with respect to the leng
Read the paragraph and find and underline the sentence fragments. There are five of them
What is the length of the longer of the two chords shown? Length of longer chord = units
There are 10 counters in a bag: 3 are red, 2 are blue and 5 are green. The conents of the bag are shaken before Maxine randomly chooses one counter from the bag
How to write the expression a+3 in words
1. Prior to the Battle of Midway, which navy was superior?
Which of the following words best describe the early beginnings of Islam? A. Tumultuous B. Peaceful C. Surprising D. Mysterious
Cette petit fille est grand et gros. Correct Incorrect
HELP ME PLEASEEEEEEEEEEEEEEEEEEEEEEEEEEE
NEED HELP ASAP PLS!!!!