Write a program to input the roll number, name and marks of five subjects (Eng , Hindi, Maths , Science, Computer) of a student. Calculate the total and display the result. in Python
Answers
Answered by
11
Answer:
# Python Program - Calculate Average and Percentage Marks
print("Enter 'x' for exit.");
print("Enter marks obtained in 5 subjects: ");
m1 = input();
if m1 == 'x':
exit();
else:
m2 = input();
m3 = input();
m4 = input();
m5 = input();
mark1 = int(m1);
mark2 = int(m2);
mark3 = int(m3);
mark4 = int(m4);
mark5 = int(m5);
sum = mark1 + mark2 + mark3 + mark4 + mark5;
average = sum/5;
percentage = (sum/500)*100;
print("Average Marks = ", average);
print("Percentage Marks = ", percentage,"%");
Similar questions
Environmental Sciences,
3 months ago
Social Sciences,
3 months ago
English,
7 months ago
English,
7 months ago
Science,
11 months ago
Math,
11 months ago
Math,
11 months ago