How to show def functions and exception handling in a flowchart?
In case of two def functions, each function should have it's own try and except keywords.
Def functions and exceptions handling can be shown in a flowchart using try and except keywords. If exception raised is false, program executes normally, but if the exception is true, program terminates and an error message is displayed.
N = int(input("Enter the numerator: "))
D = int(input("Enter the denominator: "))
try:
Q = N / D
print("Quotient:", Q)
except ZeroDivisionError:
print("Denominator cannot be zero")
N = int(input())
D = int(input())
try:
Q = N / D
print("Quotient:", Q)
except ZeroDivisionError:
print("Denominator cannot be zero")
Comments
okay thank you Then if there are two def functions, How we show that?
Leave a comment