user outepu
This commit is contained in:
+3
-3
@@ -14,13 +14,13 @@ class Subject:
|
||||
def add_grade(self, category, grade):
|
||||
self.grades[category][0].append(grade)
|
||||
|
||||
def return_grades(self, category):
|
||||
def return_grades(self, category): # Return all grades in one category
|
||||
return self.grades[category][0]
|
||||
|
||||
def return_grade_categories(self):
|
||||
def return_grade_categories(self): # Return all categories
|
||||
return [i for i in self.grades]
|
||||
|
||||
def return_average_of_category(self, category):
|
||||
def return_average_of_category(self, category): # Return average of one categorie
|
||||
return sum(self.grades[category][0]) / len(self.grades[category][0])
|
||||
|
||||
def return_average_of_subject(self):
|
||||
|
||||
+7
-3
@@ -33,6 +33,10 @@ def user_input():
|
||||
return "input", "grade", subject, category, grade, grade_name
|
||||
|
||||
|
||||
def user_output(i):
|
||||
# just filled with some standard output, has to be filled further
|
||||
print(i)
|
||||
def user_output(subject, categories, average):
|
||||
print("\n\n In the subject [] are the following categories:".format(subject))
|
||||
for counter, category in enumerate(categories):
|
||||
print("The average in [] is [] with these grades:".format(category, average[counter]))
|
||||
for grade in category:
|
||||
print(grade)
|
||||
print("\n")
|
||||
|
||||
Reference in New Issue
Block a user