##### Print max numbers in a list
 Print max numbers in a list jimmoriarty Unladen Swallow Posts: 1 Threads: 1 Joined: Sep 2020 Reputation: 0 Sep-25-2020, 07:04 AM So, guys, i'm having a problem with my code. What i need to do is take grades of n students and put on a list, and take their grades e put on otherlist what i did, but, i'm not getting print the names of the students if more than one get the highest grade. My code until now: ```student = [] grade = [] maxStudents =[] while len(student) < 5: student.append(input('Write de student name')) grade.append(int(input('Write the student grade'))) for i in grade: if i == max(grade,key=int): maxStudents.append(student[grade.index(i)]) print(maxStudents)``` Reply

 Messages In This Thread Print max numbers in a list - by jimmoriarty - Sep-25-2020, 07:04 AM RE: Print max numbers in a list - by DPaul - Sep-25-2020, 07:29 AM

 Possibly Related Threads… Thread Author Replies Views Last Post adding numbers in a list Nickd12 2 75 8 hours ago Last Post: Serafim Print variable values from a list of variables xnightwingx 3 399 Sep-01-2020, 02:56 PM Last Post: deanhystad importing a list of numbers into python script barrypyth 8 604 Aug-22-2020, 09:10 PM Last Post: barrypyth Print the number of items in a list on ubuntu terminal buttercup 2 471 Jul-24-2020, 01:46 PM Last Post: ndc85430 Is there a way i print odd and even numbers separately? spalisetty06 5 435 Jul-21-2020, 06:48 PM Last Post: spalisetty06 Summing a list of numbers Oldman45 6 471 Jul-12-2020, 05:30 PM Last Post: Oldman45 How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000 Pleiades 6 3,487 Jul-01-2020, 03:53 PM Last Post: ndc85430 Topic: “Filter numbers with a list comprehension” (PyBite #107) Drone4four 4 482 Jun-11-2020, 08:31 PM Last Post: Drone4four taking input doesnt print as list bntayfur 2 401 Jun-04-2020, 02:48 AM Last Post: bntayfur Supposed to print out even numbers DallasPCMan 4 420 May-21-2020, 05:50 PM Last Post: ndc85430

Forum Jump:

### User Panel Messages

##### Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020