Python program to Return Value of 2 Arguments Using Function

def avg(num1,num2):
 x = (num1+num2)/2
 return x
y = int(input("Insert first value: "))
z = int(input("Insert second value: "))
average = avg(y,z)
print(round(average,2))

 

 

Output:

Insert first value: 40
Insert second value: 47
43.5

 

Insert first value: 109
Insert second value: 119
114.0

 

 

Subscribe For Daily Updates

100+ Python Pattern Examplespython pattern examples - star patterns, number patterns