Mega Code Archive

 
Categories / Python Tutorial / Statement
 

Tryexcept block with string argument

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