Program to calculate sum of the marks of six subjects and find average and percentage
Explanation :
Read Marks obtained in six subjects using int(input())
Average=sum of the marks obtained / total number of marks
Percentage = (marks obtained / total)*100
Sample Input 1:
50
60
65
80
55
85
Sample Output 1:
average = 65.833333333
percentage = 65.8333333
sum = 395
PROGRAM IN PYTHON
sanskrit = int(input("enter marks "))
python = int(input("enter marks "))
english = int(input("enter marks "))
maths = int(input("enter marks "))
chemistry = int(input("enter marks "))
physics = int(input("enter marks "))
total=600
#total marks obtained
marks_obtained = (sanskrit+ python+ english+ maths+ chemistry+ physics)
print("sum of marks is ",marks_obtained)
#Average
average = (sanskrit+python+english+maths+chemistry+physics)/6
print("average is ",average)
# percentage
percent = (marks_obtained / total)*100
print("percentage is ",percent)
Output
enter marks 65
enter marks 65
enter marks 50
enter marks 60
enter marks 60
enter marks 0
sum of marks is 300
average is 50.0
percentage is 50.0
Comments
Post a Comment
Type Your Comments !
Please do not enter any spam link in the comment box.