How to Create Function in Python
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python
Program 1
def display():
print("Welcome in python function")
def addition():
a=int(input("Enter first number"))
b=int(input("Enter second number"))
c=a+b
print("Addition is : ",c)
def sub():
a=int(input("Enter first number"))
b=int(input("Enter second number"))
c=a-b
print("Addition is : ",c)
def grater():
a=int(input("Enter first number"))
b=int(input("Enter second number"))
print("Grater Number is : ",a) if(a>b) else print("Grater Number is : ",b)
# Programmer
# print("start")
# display()
# print("End")Program 2
import dataflair as d #d.addition() d.grater()
Did you like this article? If Yes, please give DataFlair 5 Stars on Google

