Showing posts with label python how to convert Nonetype to int or string. Show all posts
Showing posts with label python how to convert Nonetype to int or string. Show all posts

python how to convert Nonetype to int or string

Error:TypeError: int() argument must be a string or a number, not 'NoneType'
 
solution:
try:
    answer = my_value / divisor
except TypeError:
    answer = 0