[ create a new paste ] login | about

Link: http://codepad.org/WBLfziMm    [ raw code | output | fork ]

Python, pasted on Nov 8:
import random
def pick_cards(n):
    cards=(Ac,As,Ad,Ah,2c,2s,2d,2h,3c,3s,3d,3h,4c,4s,4d,4h,5c,5s,5d,5h,6c,6s,6d,6h,7c,7s,7d,7h,8c,8s,8d,8h,9c,9s,9d,9h,10c,10s,10d,10h,Jc,Js,Jd,Jh,Qc,Qs,Qd,Qh,Kc,Ks,Kd,Kh)
    unique_cards=set()
    for i in range(n):
        c=random.choice(cards)
        unique_cards.add(c)
    return unique_cards
def print_cards(h):
    for c in h:
        print(c,end=' ')
    print()
    
    
def main():
    n=int(input('how many cards? '))
    unique=pick_cards(n)
    print('your hand:')
    print_cards(unique)
main()
    
    


Output:
1
2
3
4
  Line 3
    cards=(Ac,As,Ad,Ah,2c,2s,2d,2h,3c,3s,3d,3h,4c,4s,4d,4h,5c,5s,5d,5h,6c,6s,6d,6h,7c,7s,7d,7h,8c,8s,8d,8h,9c,9s,9d,9h,10c,10s,10d,10h,Jc,Js,Jd,Jh,Qc,Qs,Qd,Qh,Kc,Ks,Kd,Kh)
                        ^
SyntaxError: invalid syntax


Create a new paste based on this one


Comments: