Discover a world of knowledge at Westonci.ca, where experts and enthusiasts come together to answer your questions. Join our Q&A platform and get accurate answers to all your questions from professionals across multiple disciplines. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

Python pseudocode: Can anyone please help me please? I’m so desperate for the answer.


Python Pseudocode Can Anyone Please Help Me Please Im So Desperate For The Answer class=

Sagot :

Answer:

You need “input(prompt)” and “sum(iterable)”

Explanation:

import numpy

class Students:

   def __init__(self, students_size, marks_size):

       self.students_size = students_size

       self.marks_size = marks_size

   def input_name(self):

       return input("Name of the student:")

   def input_marks(self):

       for __ in range(self.marks_size):

           yield int(input("Mark:"))

   def input_students_data(self):

       for __ in range(self.students_size):

           name = self.input_name()

           yield name, list(self.input_marks())

if __name__ == "__main__":

   students = Students(students_size=3, marks_size=5)

   name = numpy.empty([students.students_size], dtype="<U100")  

   # more space might be needed for long names      

   marks = numpy.empty([students.students_size, students.marks_size])

   for i, (student_name, student_marks) in enumerate(                        

           students.input_students_data()):

       name[i] = student_name

       marks[i] = student_marks

       total = sum(student_marks)

       print("total: {:g}, average: {:g}".format(total, float(total)/students.marks_size))

We appreciate your visit. Hopefully, the answers you found were beneficial. Don't hesitate to come back for more information. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Thank you for visiting Westonci.ca. Stay informed by coming back for more detailed answers.