Home  >  Article  >  Backend Development  >  How to output average grade in python

How to output average grade in python

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-08-02 13:42:3110016browse

How to output average grade in python

The first step is to open the local python IDE tool and create a new python file named test6.py.

How to output average grade in python

How to output average grade in python

How to output average grade in python

##Related recommendations: "

Python Video Tutorial"

The second step is to define an average that prompts the user to enter how many numbers to calculate.

How to output average grade in python

The third step is to initialize the value of sum. Note that it is a good coding practice to give an initial value when defining a variable.

How to output average grade in python

#The fourth step is to loop through the numbers to be calculated and calculate the sum value.

How to output average grade in python

The fifth step is to calculate the average and output it. Use the "sum/quantity" formula to calculate the average.

How to output average grade in python

The sixth step, after the coding is completed, remember to save and then debug and run. Press the F5 key or click "run"->"run model" in the menu bar to run the program.

How to output average grade in python

How to output average grade in python

The above is the detailed content of How to output average grade in python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn