Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
 
PREVIOUS NEXT
Tagged: #fix #valueerror #python
ADD COMMENT
Topic
Name
9+7 =