Kebap wrote:How would you do it without a computer? Try to split the problem into many simple steps. Then solve these steps one by one.
No, you do not need that import. Your current solution will forget all inputs, whenever it gets the next one. Do you already know about lists in python?
Ofnuts wrote:You don't need lists here. You need to know the current total and how many grades you have included in it.
NotASeagull wrote:So, I'm pretty new to python, but I've got an assignment in which I must calculate the average of a range of variables given by the user. Variables are supposed to be grades.
for c in range (0,50)
Grade = input ("What is the student's grade?')
How do I get the average of all the user''s inputs?
Should I use import statistic mean?
Also, how could I get how many graded are below 50 and above or equal to 50
Grade = input ("What is the student's grade?)
Skaperen wrote:Ofnuts wrote:You don't need lists here. You need to know the current total and how many grades you have included in it.
if the number of scores is large and/or wide ranging, summing them in sorted order is a good idea. therefore collecting the scores in a list (or maybe OrderedDict) is a good idea.
Users browsing this forum: No registered users and 2 guests