Answers for "print error on unexpected input in python"

0

how to fix valueerror in python

#Instead of
a = int(input("What is x?"))
#Put
try:
  	a = int(input("What is x?"))
except ValueError:
  print ("Insert ValueError message here")
#This way your program won't crash
Posted by: Guest on April-19-2020
0

how to fix valueerror in python

#Instead of
a = int(input("What is x?"))
#Put
try:
  	a = int(input("What is x?"))
except ValueError:
  print ("Insert ValueError message here")
#This way your program won't crash
Posted by: Guest on April-19-2020

Code answers related to "print error on unexpected input in python"

Python Answers by Framework

Browse Popular Code Answers by Language