Skip to content

Instantly share code, notes, and snippets.

@lmaresz
Last active August 29, 2015 14:09
Show Gist options
  • Save lmaresz/026423b55fc29bea4c28 to your computer and use it in GitHub Desktop.
Save lmaresz/026423b55fc29bea4c28 to your computer and use it in GitHub Desktop.
úszás
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