Hello! I'm Seniru - a person who is trying to understand what the world is. I like pizza and coding and I find myself as a patient, self-confident and a systematic person with a strong desire
importrandomasrandclassStudent:def__init__(self,name,fives,tens,twenties):self.name=nameself.fives=fivesself.tens=tensself.twenties=twentiesdefgetMoney(self):returnself.fives*5+self.tens*10+self.twentiesdef__str__(self):returnself.name+" "+str(self.getMoney())#Creating a list of students
students=sorted([Student('Student'+str(s),rand.randint(0,10),rand.randint(0,10),rand.randint(0,10))forsinrange(20)],key=lambdas:s.getMoney(),reverse=True)forsinstudents:print(s)print('Student with highest amount:',end=' ')iflen(students)==1:print(students[1])elifstudents[0]==students[::-1]:print('All')else:print(students[0])
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My try with python