Write a Python program to :
a. Calculate average marks of 3 subjects
b. Calculate Simple Interest
Answers
Answered by
2
def _sum(nums):
_sum = 0
for n in nums:
_sum += n
return _sum
average = lambda marks: _sum(marks) / len(marks)
simple_interest = lambda p, r, t: p * (r / 100) * t
print("Average:", average((a := list(map(float, input("3 marks: ").split())))))
print()
p, r, t = float(input("p: ")), float(input("r: ")), float(input("t: "))
print("Simple Interest:", simple_interest(p, r, t))
Similar questions
Physics,
2 months ago
History,
2 months ago
Math,
2 months ago
English,
5 months ago
Hindi,
11 months ago
India Languages,
11 months ago
India Languages,
11 months ago