Code:
try:
a = int(input('First number: ',))
b = int(input('Second number: '))
print("Your result is ", a/b)
except ZeroDivisionError:
print('Error: Division by zero will not work.')
try:
a = int(input('First number: ',))
b = int(input('Second number: '))
print("Your result is ", a/b)
except ZeroDivisionError:
print('Error: Division by zero will not work.')
gde je greska?
isto mi pokazuje i kad dodam:
Code:
except (ZeroDivisionError, ValueError, TypeError) as e:
print('Error: ', e')
except (ZeroDivisionError, ValueError, TypeError) as e:
print('Error: ', e')