Skip to content

NBHS-STEM/deck-class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assignment: Custom Class

You will create a Deck() class in Python. The Deck() class is sketched out for you in deck-assignment.py, where I've also given you lists of ranks and suits.

Save your solution as deck.py.

Remember, your solution must have the following:

  • an __init__ method that initializes a shuffled deck.
  • a __repr__ method
  • a deal() method that returns a single card. This card should no longer be part of the deck.

I've included a __len__ method so that the len() function will work on your deck, allowing you to check the behavior of your deal() method.

Good luck!

About

A minimal Python deck of cards.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages