try/except block with string argument : Except : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Except »

 

try/except block with string argument


x = '0'
try:
    x = int(x)
except TypeError:
    raise TypeError("%r is not a valid integer" % x)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» Except