Computer Science, asked by kingsleychellakkumar, 10 months ago

Write a python program to print the average of 4 numbers using Python functions.

Answers

Answered by Anonymous
2

Answer:

# Python program to get average of a list

# Using reduce() and lambda

# importing reduce()

from functools import reduce

def Average(lst):

return reduce(lambda a, b: a + b, lst) / len(lst)

# Driver Code

lst = [15, 9, 55, 41, 35, 20, 62, 49]

average = Average(lst)

# Printing average of the list

print("Average of the list =", round)

Explanation:

plz mark me as brainliest and follow me

Answered by Princejj969
3

Answer:

def avg(a,b,c,d):

      avrg=(a+b+c+d)/4.0

      print("Average value = ",avrg)

n1=int(input("Enter the first number "))

n2=int(input("Enter the second number "))

n3=int(input("Enter the third number "))

n4=int(input("Enter the fourth number "))

avg(n1,n2,n3,n4)

PLEASE MARK MY ANSWER AS BRAINLIEST!!! PLEASE FRIEND!!

Similar questions