# Python program to find the average of final exam marks

Ask the user to provide final exam marks of 10 students in Introduction to Computing course in
order to calculate the average. Use while loop for this purpose, and use break statement to exit the
loop when an invalid input (e.g negative number) is given. Moreover, if marks greater than 100
are given, use continue statement to skip that number from average calculation.

```
# Ask the user to provide final exam marks of 10 students in Introduction to Computing course in  order to calculate the average. Use while loop for this purpose, and use break statement to exit the loop when an invalid input (e.g negative number) is given. Moreover, if marks greater than 100  are given, use continue statement to skip that number from average calculation.

student_marks = int(input('Enter the marks, use -1 to stop: '))
student_marks_counter = 1
total_marks = 0
while student_marks_counter <=10:
student_marks = int(input('Enter the marks, use -1 to stop: '))
if student_marks == -1:
break
if student_marks > 100:
continue
else:
print('Student Marks = ', student_marks)
total_marks += student_marks
print('Total Marks', total_marks)
student_marks_counter += 1
print('The average is', total_marks / 10 )

# This code is contributed by Ahmad Shafiq

``` ## Love this read? Subscribe to Modernage!

Do you have any queries? You can ask in the comments. We, at Modernage answer each and every question, asked in the comments, so If you have any queries, or you want to know about any specific platform you can ask in the comments below

## Author ## More Articles.  ### Python program to take two integers from the user and determine and print whether the first is a multiple of the second.

Here is the code for the python program to take two integers from the user and determine and print whether the first is a multiple  ### What is Blockchain: A beginners guide to blockchain

With the technology evolving more than ever, we have entered a phase where you will have full control over your data and you can choose  ### Find the square root of 50 using Guess and Check and Bisection algorithms.

Here is the code of finding the square root of 50 using Guess and Check and Bisection algorithms. .

## Python

### Python program that reads an integer and determines and prints whether it’s odd or even ## More Articles.  ### 7 Proven ways How to make money with cryptocurrency 

The process of making money from cryptocurrency in 2022  ### Online Shopping in Pakistan: Ultimate Guide (Jan. 2022)

The concept of online shopping has revolutionized the way  