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
English,
2 months ago
Business Studies,
2 months ago
English,
4 months ago
Hindi,
9 months ago
India Languages,
9 months ago
India Languages,
9 months ago