Created
March 5, 2014 19:30
-
-
Save mehmetkose/9374745 to your computer and use it in GitHub Desktop.
iddaa maç sonucu üreteci.
This file contains hidden or 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
import random | |
macsayisi = 3 | |
kuponsayisi = 600 | |
ornekkupon = [[0,0], [0,0], [1, 0], [1, 1]] | |
def skor_uret(): | |
return random.randint(0,2) | |
def kupon_uret(macsayisi): | |
kupon = [] | |
i = 0 | |
while i < macsayisi: | |
skor = [skor_uret(),skor_uret()] | |
kupon.append(skor) | |
i+=1 | |
return kupon | |
def deste_uret(kuponsayisi): | |
kuponlar = [] | |
i = 0 | |
while i < kuponsayisi: | |
kupon = kupon_uret(macsayisi) | |
if not kupon in kuponlar: | |
kuponlar.append(kupon) | |
i+=1 | |
#print kuponlar | |
return kuponlar | |
kuponlarim = deste_uret(kuponsayisi) | |
for i in kuponlarim: | |
if i == ornekkupon: | |
print "kupon tuttu" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment