Write a Python program to enter marks of five subjects and calculate total, average and percentage.

PROGRAM

# Input marks of five subjects
mark1 = float(input(“Enter marks of Subject 1: “))
mark2 = float(input(“Enter marks of Subject 2: “))
mark3 = float(input(“Enter marks of Subject 3: “))
mark4 = float(input(“Enter marks of Subject 4: “))
mark5 = float(input(“Enter marks of Subject 5: “))
# Calculate total, average, and percentage
total = mark1 + mark2 + mark3 + mark4 + mark5
average = total / 5
percentage = (total / 500) * 100 # Assuming each subject is out of 100
# Display the results
print(f”\nTotal Marks: {total}”)
print(f”Average Marks: {average}”)
print(f”Percentage: {percentage:.2f}%”)

OUTPUT

TRY THE ABOVE CODE

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.