Skip to content

Instantly share code, notes, and snippets.

@pasali
Created December 5, 2011 20:57
Show Gist options
  • Save pasali/1435311 to your computer and use it in GitHub Desktop.
Save pasali/1435311 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#-*-coding:utf-8-*-
class Kesir:
def __init__(self,x,y):
self.pay = x
self.payda = y
def enBuyukbul(liste):
bolumler = []
sonuc = 0
for i in liste:
sonuc = float(i.pay)/i.payda
bolumler.append(sonuc)
buyuk= max(bolumler)
sira = bolumler.index(buyuk)
k = liste[sira]
return str(k.pay)+"/"+str(k.payda)
k1 = Kesir(2,4)
k2 = Kesir(6,5)
k3 = Kesir(8,9)
kesirler = [k1,k2,k3]
print enBuyukbul(kesirler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment