DEV Community

Lakshmi Pritha Nadesan
Lakshmi Pritha Nadesan

Posted on

Write a program to SSLC Mark Percentage Calculator

SSLC Mark Percentage Calculator:

To calculate the total mark percentage, you can use the formula:

Percentage of marks = (Total marks earned/marks available) * 100

Here are the steps to calculate the total mark percentage:

-Add up the total points earned
-Add up the total points possible
-Divide the total points earned by the total points possible
-Multiply the result by 100 
Enter fullscreen mode Exit fullscreen mode

Example:

468/500*100=93.6

len() returns the number of characters in a text string.

print("Welcome to SSLC Marksheet")  # Display a welcome message

# Taking input marks for each subject
tamil = int(input("Tamil mark : "))        # Tamil mark input
english = int(input("English mark : "))    # English mark input
maths = int(input("Maths mark : "))        # Maths mark input
science = int(input("Science mark : "))    # Science mark input
social = int(input("Social mark : "))      # Social mark input

# Calculating the total marks
result = tamil + english + maths + science + social
print("Total Mark :", result)               # Display total marks

# Creating a list to store marks
max_mark = [tamil, english, maths, science, social]

# Calculate percentage
percent = result / (len(max_mark) * 100) * 100  # Formula for percentage
print("Percentage (%):", round(percent, 2))     # Display the percentage, rounded to 2 decimal places




Enter fullscreen mode Exit fullscreen mode

Output:

Welcome to SSLC Marksheet
Tamil mark : 98
English mark : 88
Maths mark : 98
Science mark : 88
Social mark : 96
Total Mark : 468
Percentage (%): 93.6
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more