Python Programs
Python Programs
total = 0
while True:
num = int(input("Enter a number (0 to stop): "))
if num == 0:
break
total += num
print("Total sum:", total)
7. Python program to input principal, rate of interest, and time, and find simple
interest
marks = []
for i in range(5):
marks.append(float(input(f"Enter marks for subject {i+1}: ")))
total = sum(marks)
percentage = total / 5
print(f"Total Marks: {total}")
print(f"Percentage: {percentage:.2f}%")