input输入接收的数据默认是str类型,可通过如下方式转换到数据格式
try:
x = int(input('Enter the first number: '))
y = int(input('Enter the second number: '))
print(x/y)
except ZeroDivisionError:
print("The second number can't be zero!")
input输入接收的数据默认是str类型,可通过如下方式转换到数据格式
try:
x = int(input('Enter the first number: '))
y = int(input('Enter the second number: '))
print(x/y)
except ZeroDivisionError:
print("The second number can't be zero!")