Python will give you high rating for correct help Easy Python Problem (see pic): Guides are available on the template below on what code to put: Template: ### Use this template
Python
will give you high rating for correct help
Easy Python Problem (see pic):
Guides are available on the template below on what code to put:
Template:
### Use this template
import random
class Card:
def __init__(self, value, suite):
self.value = value
self.suite = suite
def __str__(self):
return f"{self.value} of {self.suite}"
def __eq__(self, other):
"""Check if two cards are the same"""
# -- YOUR CODE HERE --
class CardSet:
def __init__(self):
self.cards = []
def view(self):
for card in self.cards:
print(card)
def add_cards(self, cards):
"""Add cards to your set"""
# -- YOUR CODE HERE --
class Deck(CardSet):
def __init__(self):
"""Initialize the 52-card set. Start from 1-11, then Jack, Queen, King, then by suite: clubs, spades, hearts, diamonds"""
cards = []
# -- YOUR CODE HERE --
self.cards = cards
def count_cards(self):
""""Count the number of cards in a deck"""
# -- YOUR CODE HERE --
def shuffle(self, seed=None):
"""Shuffle your deck using a random seed"""
random.seed(seed)
# -- YOUR CODE HERE --
def peek(self, number=5):
"""Show the top n cards of the stack. This is analogous to getting the last n cards then reversing it."""
# -- YOUR CODE HERE --
def draw(self, cardset, number=5):
"""Transfer the top n cards of the stack to your cardset."""
# -- YOUR CODE HERE --
def add_cards(self):
pass
if __name__ == "__main__":
seed, hand, peek = input().split(",")
myDeck = Deck()
handA = CardSet()
handB = CardSet()
myDeck.shuffle(int(seed))
for x in range(1,3):
print(f"\nRound {x}:")
myDeck.draw(handA, int(hand))
myDeck.draw(handB, int(hand))
print("Hand A: ")
handA.view()
print("Hand B: ")
handB.view()
myDeck.count_cards()
if(x == 1):
print(f"\n{peek} Cards at the top: ")
myDeck.peek(int(peek))
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images