Update 531.py

Catch ValueError exception and print an error.