I cannot figure out how to write this code. According to the idea, this task is written through lists and classes. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

I cannot figure out how to write this code. According to the idea, this task is written through lists and classes.

Write a function that takes string arguments: first name, last name, student class, as well as a list of ratings. The function should calculate the average score and display it on the screen in in the form "Student of grade N Last name First name has an average grade of M".

5th Jul 2021, 9:35 AM
Ф. Е. Ю.
Ф. Е. Ю. - avatar
2 Answers
+ 6
Ф. Е. Ю. , may be you can show us your attempt first? => please put your code in playground and link it here. thanks!
5th Jul 2021, 9:43 AM
Lothar
Lothar - avatar
0
print("Start programm:") import time a = str(input("Введите свое имя: ")) b = str(input("Введите свою фамилию: ")) c = str(input("Введите свое отчество: ")) d = str(input("Введите свой год рождения: ")) e = str(input("Введите свою группу: ")) class Student: def _init_(self, a, b, c, d, e): time.sleep(3) # Задержка для выяснения когда показывается сам конструктор print("Содержимое конструктора:") self.abcde = list() self.a = a self.b = b self.c = c self.__d = d self._e = e print(a, b, c, e, d) def _del_(self): time.sleep(5) print("Содержимое деструктора:") print("Удален список класса студент" % self.abcde) pt = Student(a, b, c, e, d) pt._e pt.Student_d print("Моя группа:", pt.Student_d, "Мой год рождения:", pt._e) del pt print("Мои ФИО:", b, a, c, "Мой год рождения:", d, "Моя группа:", e) print("End programm!")
5th Jul 2021, 10:02 AM
Ф. Е. Ю.
Ф. Е. Ю. - avatar