- 1
I want the program to show a error message...
I don't want the program to quit unexpectedly whenever someone types a string in the input. Instead, I want to show a error message, e.g, "Must type an integer there..." Here's a code I made to show the list of Fibonacci Sequence to a certain value... num1, num2, num3 = 0, 1, 0 limit = int(input("Upto which number do you want the list of Fibonacci Series? : ")) while num3 <= limit: print(num3) num1, num2 = num2, num3 num3 = num1 + num2 https://code.sololearn.com/cRV535LGA1xe/?ref=app And here's in Sololearn a few things are different. I use to code in Pycharm, which works the best for me..!
1 Respuesta
+ 2
Use try and except
https://code.sololearn.com/ceEzAFNctOwC/?ref=app