Computer Science, asked by diljotsinghdhillon, 1 year ago

write a Python program to read marks in 6 subject and calculate total and percentage​

Answers

Answered by inboxsgk
7

MarkA = int(input("enter mark of 1st subject"))

MarkB = int(input("enter mark of 2nd subject"))

MarkC = int(input("enter mark of 3rd subject"))

MarkD = int(input("enter mark of 4th subject"))

MarkE = int(input("enter mark of 5th subject"))

MarkF = int(input("enter mark of 6th subject"))

total = MarkA + MarkB + MarkC + MarkD + MarkE + MarkF

print("The total mark is ", total)

percent = total / 6

print("Total percentage = ", percent, "%")

#Mark this answer as brainliest if this helps you

Answered by Equestriadash
17

The following codes must be typed in script mode, saved and then executed.

CODE:

sub1 = float(input("Enter the marks of subject 1:"))

sub2 = float(input("Enter the marks of subject 2:"))

sub3 = float(input("Enter the marks of subject 3:"))

sub4 = float(input("Enter the marks of subject 4:"))

sub5 = float(input("Enter the marks of subject 5:"))

sub6 = float(input("Enter the marks of subject 6:"))

total = sub1 + sub2 + sub3 + sub4 + sub5 + sub6

avg = total/6

print("The total percentage is", avg, "%")

OUTPUT:

\tt Enter\ the\ marks\ of\ subject\ 1: 24

\tt Enter\ the\ marks\ of\ subject\ 2: 14

\tt Enter\ the\ marks\ of\ subject\ 3: 21

\tt Enter\ the\ marks\ of\ subject\ 4: 22

\tt Enter\ the\ marks\ of\ subject\ 5: 24

\tt Enter\ the\ marks\ of\ subject\ 6: 22

\tt The\ total\ percentage\ is\ 21.16\ \%

Similar questions