Last active
August 29, 2015 14:09
-
-
Save lmaresz/026423b55fc29bea4c28 to your computer and use it in GitHub Desktop.
úszás
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
class Uszo: | |
def __init__ (self,rajtszam,ev,ido): | |
self.ev = ev | |
self.ido = ido | |
self.rajtszam = rajtszam | |
tomb = [] | |
tombe = [] | |
for i in range(12): | |
tomb.append(Uszo(i,randint(6,75),randint(103,500))) #A tömb feltöltése random számokkal | |
#tomb.insert(3,(Uszo(3,randint(6,75),tomb[1].ido)) | |
tomb.sort (key = lambda x : (x.ido, x.ev)) #rendezi a tömböt idő szerint | |
print ("A leggyorsab a {0}. rajtszámú versenyző".format(tomb[0].rajtszam)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment