Sep-01-2017, 10:25 PM
My name is Nico,
I'm programmer i search possible answer for this code!
i recived error!
this is output:
tried it python 3.6.2 and 3.5.3 Linux
P.S. don't use IDE for python simple texteditor
I'm programmer i search possible answer for this code!
numeri = [i for i in range(1,91)] giusti = [] utente = input("Inserisci i numeri separati da vergola") for i in utente.split(","): if(i.isdecimal()): if(int(i)<=90 and int(i)>=1): print("Debug il numero è giusto") giusti.append(i) numeri.pop(int(i)) else: print("il numero è sbagliato") print("I numeri sono esatti")Enter the sequence at the code launch 1,24,90,99,8
i recived error!
this is output:
Inserisci i numeri separati da vergola 1,24,90,99,8 Debug il numero è giusto Debug il numero è giusto Debug il numero è giusto Traceback (most recent call last): File "programma.py", line 9, in <module> numeri.pop(int(i)) IndexError: pop index out of rangeif you follow the program, you will understand that it runs .pop for number 99, this is strange.. with other sequence numbers does not happen
tried it python 3.6.2 and 3.5.3 Linux
P.S. don't use IDE for python simple texteditor