Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- b=''
- score=0
- jackpot=0
- def generate():
- count=0
- list2=[]
- while 1:
- import random
- z=random.randrange(0,10)
- list2.append(z)
- count=count+1
- if count==3:
- a=''
- for k in list2:
- a=a+str(k)+' '
- global b
- b=b+a
- return a
- def matching(b):
- if b[6]==b[8] or b[6]==b[10] or b[8]==b[10]:
- if b[6]==b[8] and b[8]==b[10]:
- if b[6]==7:
- number=5
- global score
- score=score+5
- global jackpot
- jackpot=jackpot+1
- return number
- else:
- global score
- score=score+2
- number=2
- return number
- else:
- global score
- score=score+1
- number=1
- return number
- else:
- number=0
- return number
- def print_result(score,jackpot):
- z=print('점수 :',score,'잭팟 횟수 :',jackpot)
- return z
- while 1:
- print('뽑힌 숫자 :',generate())
- print('얻은 점수 :',matching(b))
- z=input('그만하시겠습니까? : ')
- if z=='n':
- b=''
- continue
- elif z=='y':
- print_result(score,jackpot)
- break
Advertisement
Add Comment
Please, Sign In to add comment