Computer Science, asked by sugaarmy4084, 1 month ago

Write a python program to input the roll number ,name and Mark's in five subjects of a student. Calculate the total and percentage Mark's of the student

Answers

Answered by TSGSOMUDRA
4

Python program to enter the marks of five subjects and calculate total, average, and percentage. There are you will learn how to find the total, average, and percentage value of the five subjects in Python language.

 

Formula:

total = p + c + m + e + h

average = total / 5.0

percentage = (total / 500.0) * 100

 

Where:

p, c, m, e, and h are the five subjects

Let us understand this example through Python program:

# Python program to enter the marks of five subjects and calculate total, average, and percentage

print("Enter the marks of five subjects::")

p, c, m, e, h, total, average, percentage = float(input()), float(input()), float(input()), float(input()), float(input()), None, None, None

# p, c, m, e, and h are the five subjects

# p = physics

# c = chemistry

# m = math

# e = english

# h = history

# Calculate total, average and percentage

total = p + c + m + e + h

average = total / 5.0

percentage = (total / 500.0) * 100

# Output

print("The Total marks   = ", total, "/500.0")

print("The Average marks = ", average)

print("The Percentage    = ", percentage, "%")

 

Output Screen:

Enter the marks of five subjects::

95

85

74

64

53

The Total marks      =  371.0 /500.0

The Average marks =  74.2

The Percentage       =  74.2 %

Answered by aj200260
12

Answer:

i=["physics","chemistry","maths","computer","english"]

total=0

for a in range(len(i)):

        print("Enter input for",i[a])

        rno=int(input("enter roll no:"))

        name=input("enter students name:")

        marks=int(input("enter marks:"))

        total+=marks

print("Total marks of",name,"is",total)

print("Total percentage is",total/5)

I MADE THIS PROGRAM HOPE IT WORKS!

PLEASE MARK ME AS BRAINLIEST

THANK YOU!

       

Similar questions