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]
3 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]3 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
Code a call to the function anotherFunc passing the array myints.
mario62 [17]

Answer:

d)anotherFunc(myints);

Explanation:

When we call a function we just have to pass the names of the arguments to the function.In case of arrays we also just have to pass the name of the array.We don't have to worry about the square brackets.So the function call will be like this.

anotherFunc(myints);

Hence the answer is option d.

4 0
3 years ago
Which cell address indicates the intersection of the first row and the first column in worksheet?
Rzqust [24]

Answer:

A. A1

Explanation:

Worksheet's Columns are named with Alphabets. i.e. A,B,C,D,E....

And Worksheet's rows are named with numbers. i.e. 1,2,3,4,5....

So the intersection of first row number as "1" and First Column name as "A" is A1 as worksheet displays column name first and then row number.

8 0
3 years ago
Read 2 more answers
What is meant by the term drill down?
andrezito [222]

Answer:

 The drill down term is basically used in the information technology for the explore the multidimensional information or data by navigating the different layers of the data from the web page applications.  

Drill down basically involve in the database by accessing the specific information through the database queries. Each query basically increase the data granularity. This term is also involve with the link for represent the details more specifically.

The drill down is the simple approach or technique for dividing the complex problems into small parts so that it make the technique more efficient.

7 0
3 years ago
Which type of vulnerability scan mimics the work of a threat actor who has already exploited a vulnerability and compromised cre
Vilka [71]

There are different type of vulnerability scan. The type of vulnerability scan mimics the work of a threat actor is called Credential Vulnerability Scan.

Credential Vulnerability Scan is known to be a scan in which there is a valid authentication of credentials Example are usernames and passwords etc. are known to be supplied to the vulnerability scanner to mimic the work of a threat actor that has these credentials.

They are known to be very slow but can give an in-depth insight into the system by accessing a wide range of the installed software  

Learn more from

brainly.com/question/14728460

5 0
2 years ago
Which of the following electronic collaboration techniques is the best
muminat

Answer:

D. project management software

6 0
3 years ago
Read 2 more answers
Other questions:
  • Describe shortly about the following Linux directories and theirpurpose,1. lib2. etc3. Boot4. Root5. home
    6·1 answer
  • Which animation effects allow text or images to show movement on a slide? Check all that apply. Entrance, Emphasis, Exit, Motion
    5·2 answers
  • How might a company go about performing a load test on their website?
    7·1 answer
  • Which of the following would an NSA professional most likely need?
    5·2 answers
  • The names of the governing body or organizationds that creates rules for information technology and information communication te
    9·1 answer
  • "Random Bars" is considered to be a Transition style<br> O True<br> O False
    11·1 answer
  • Which is the correct expansion of the term Internet?
    15·2 answers
  • How to get someone off your best friends list without blocking them
    8·1 answer
  • Write a method to add/subtract two matrices. The header of the method is as follows:
    9·1 answer
  • A(n) ______is like an intranet except it shares its resources with users from a distant location. Select your answer, then click
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!