"""
Author:Zhou
Create_Date:2022年06月18日--10:14
Tool:PyCharm
Software: PyCharm
"""

"""
用异常这种特殊的对象来管理程序执行期间发生的错误
"""

# 使用try-except代码块
print("Give me two numbers,and I'll divide them")
print("Enter 'q' to quit")
while True:
first_number = input("\nfirst_number:")
if first_number == 'q':
break
second_number = input("\nsecond_number")
if second_number == 'q':
break
try:
answer = int(first_number) / int(second_number)

except ZeroDivisionError:
print("you cant divide by 0")

else:
print("first_number/second_number=" + str(answer))