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

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay