Skip to content

Instantly share code, notes, and snippets.

@resultakak
Last active May 24, 2020 19:20
Show Gist options
  • Save resultakak/af527a94ba82b7208222836311962346 to your computer and use it in GitHub Desktop.
Save resultakak/af527a94ba82b7208222836311962346 to your computer and use it in GitHub Desktop.
secim
secmen = 15
aday = 3
esitlik = secmen / aday
ece = 0
efe = 0
ege = 0
gecersiz = 0
while True:
for x in range(secmen):
print("Adaylar: Ece, Efe, Ege")
kime = input("{}. Oyunuzu kime veriyorsunuz?\n".format(x + 1))
kime = kime.upper()
print("\n")
if kime == "ECE":
ece += 1
elif kime == "EFE":
efe += 1
elif kime == "EGE":
ege += 1
else:
gecersiz += 1
dagilim = {"ece": ece, "efe": efe, "ege": ege, "gecersiz": gecersiz}
print("Dağılım:", dagilim)
if ece <= esitlik and efe <= esitlik and ege <= esitlik:
if ece == ege or ece == efe or ege == efe:
ece = 0
efe = 0
ege = 0
gecersiz = 0
print("Seçim tekrarlanmalı!\n")
continue
kazanan = None
kazanan_adet = 0
for kim in dagilim.keys():
if dagilim[kim] > kazanan_adet:
kazanan = kim
kazanan_adet = dagilim[kim]
print("Kazanan", kazanan)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment