0

Message when an error happens? (python)

I want to make a message appear when someone doesnt input a number, the code explicitely ask for an int so error appears

16th Aug 2018, 7:08 PM
Guido Parlatore
Guido Parlatore - avatar
1 Resposta
+ 3
use a try, except block try: n = int(input()) except ValueError as e: print('you did not enter a number')
16th Aug 2018, 9:48 PM
Aidan Haddon-Wright
Aidan Haddon-Wright - avatar