Syntax Error in Try Except Python || Try and Except || Exception Handling || Python

In this, we are going to see an example on Syntax Error in Try Except Python that is done using Exception Handling in Python Programming Language.

try:
    n = int(input("Enter a number: "))
    a = 1
    for i in range(1, n+1):
        a = a * i
    print(a, end="")
    prin(" is the factorial of", n)
except Exception:
    print("\nSome syntax in the program is incorrect")

# Coded by Saahil

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post