Examine the code: Code: 1 x=eval(input("Enter value for x: \n")) 2 y=eval(input("Enter value for y: \n")) 3 z=(x+y)/(x-y
Posted: Tue Jul 12, 2022 8:17 am
Examine the code:Code:1x=eval(input("Enter value for x: \n"))2y=eval(input("Enter value for y: \n"))3z=(x+y)/(x-y)4print (z)When the program is tested with same value for x and y (for examplex=4 and y=4), it generates the following error and crashes.Traceback (most recent call last):....File "D:/xyz.py", line 3, in <module>z=(x+y)/(x-y)ZeroDivisionError: division by zeroCopy above code in your answer and insert lines where necessary forhandling the ZeroDivisionError error to save your program fromcrashing.