Advertisement
Icomey

Untitled

Mar 28th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. from cardLib.const import SUITS, VALUES, RANKS
  2.  
  3.  
  4. class Card(object):
  5.  
  6.     def __init__(self, value, suit):
  7.         try:
  8.             assert(value in VALUES))
  9.             self.value=value
  10.         except AssertionError:
  11.             print("Invalid value assigned to card")
  12.         try:
  13.             assert(suit in SUITS)
  14.             self.suit=suit
  15.         except AssertionError:
  16.             print("Invalid suit assigned to card")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement