#24 Try Except Exception Handling In Python


num1=input("Enter num 1 \n")
num2=input("Enter num 2 \n")
try:
print("the two number sum is",int(num1)+int(num2))
except Exception as e:
print(e)
print("This line is very important")
#23 Functions And Docstrings
# For using docstring we have to use three times ". Like:

def function1 (a,b) :
""""This Function Is Used To Calculate Average"""
average = (a+b)/2
return average
# The following2 lines will print average
# v= function1(5,7)
# print(v)
print(function1.__doc__)

Comments

Popular posts from this blog

Practice Execise 3

Pickle Module