1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
velikii [3]
2 years ago
13

Create a funtion makeStudent(studentlist) where studentlist is your list of Student namedtuples The function should do the follo

wing: Take user input for each of the fields of the namedtuple Create a Student namedtuple using the input Add the Student to studentlist
Computers and Technology
1 answer:
seropon [69]2 years ago
4 0

Answer:

def makeStudent(student_list):

   name = input()

   major = input()

   year = int(input())

   hhh = int(input())

   gpa = float(input())

   newstu = Student(name,major,year,hhh,gpa)

   student_list.append(newstu)

def setGPA(student,val):

   student = student._replace(gpa= val)

   return student

def setMajor(student,val):

   student = student._replace(major = val)

   return student

def setYear(student,val):

   student = student._replace(year = val)

   return student

def averageGPA(student_list):

   sum = 0

   for i in range(len(student_list)):

       sum = sum + student_list[i].gpa

   avg = sum/len(student_list)

   return avg

def getTopStudentGPA(student_list):

   max = -1000

   for i in range(len(student_list)):

       if student_list[i].gpa > max:

           max = student_list[i].gpa

   return max

Student = namedtuple('Student', ['name', 'major', 'year', 'id', 'gpa'])

stu1 = Student('Kenneth', 'Computer Science', 6, 987654321, 3.8)

stu2 = Student('Maegan', 'Neuroscience', 4, 123456789, 3.4)

namedlist = []

print (namedlist)

namedlist.append(stu1)

namedlist.append(stu2)

print(namedlist)

makeStudent(namedlist)

makeStudent(namedlist)

makeStudent(namedlist)

print(namedlist)

print(namedlist[1])

print(namedlist[3])

Explanation:

  • Create a function to take in in the information of a new student.
  • Create functions for setting GPA, a major subject and year.
  • Calculate average GPA by dividing the total GPA of student with the length of student list.
  • Get top student by checking the student having a maximum GPA .
You might be interested in
I dunno what to write my memo thing about ⁻³⁻
Alex73 [517]

Answer:

Wdym? I could help u

Explanation:

5 0
3 years ago
Read 2 more answers
Advantages of a computer​
Bess [88]

Answer:

It eases work.

It is deligent.

It is versatile.

8 0
3 years ago
Which is the correct process for opening a blank spreadsheet?
Step2247 [10]
The best way of doing this would be when you are opening a document application, the first thing that you would do in this case in to click "new". And by clicking new, you would have a fresh new spread sheet.
5 0
2 years ago
Berikan contoh perameter sebuah meja.​
lara31 [8.8K]

Answer:

The simplest of table parameters are rows, columns, page number, alternate row, column header, Table title, etc.

Explanation:

The simplest table parameter is as being mentioned above. Its, however, important to understand what are the parameters. Parameters are the features of an object that defines its behavior. Various parameters are the behaviors of the object hence, and here it is the table and the behavior of the table is being described with the parameters. There are so many other parameters that one can think of related to tables. And we should make a list of them for future studies. Font size, Font color, border, etc are some more from the huge list.

5 0
3 years ago
Which of the following is NOT an advantage of central management of information systems in the University System of Georgia? (A)
zzz [600]

Answer:

Independence

Explanation:

Management information system (MIS) is the system that acts as the backbone of an organization's activities, holding everything together. According to my research on MIS, I can say that based on the information provided within the question the one term that is not considered an advantage would be Independence. Since MIS doesn't really provide independence since the organization depends on the system.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

6 0
3 years ago
Other questions:
  • How does the use of modules provide flexibility in a structured programming design?
    14·2 answers
  • #A year is considered a leap year if it abides by the #following rules: # # - Every 4th year IS a leap year, EXCEPT... # - Every
    5·1 answer
  • Which of the following commands would instruct OSPF to advertise ONLY the 192.168.10.0/24 network in Area 0?
    13·1 answer
  • In c++ 11, the ________ tells the compiler to determine the variable's data type from the initialization value.
    6·1 answer
  • Define time management and give two activities that you can do to help manage your tasks, homework, or projects better.
    12·1 answer
  • In paragraph form, explain and describe at least three common situations in which you would yield the right-of-way.
    5·1 answer
  • What Is an Antivirus?
    14·2 answers
  • Write a Java program called Decision that includes a while loop to prompt the user to enter 5 marks using the
    12·1 answer
  • Artificial intelligence (AI) and machine learning are especially important during which security information and event managemen
    8·1 answer
  • A manager suspects that one of his team members has been fraudulently accessing confidential and sensitive information and breac
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!