made project 2

This commit is contained in:
2026-02-10 18:36:24 -05:00
parent 46f3d6be99
commit d491874a3d
9 changed files with 147 additions and 1 deletions

22
Project 2/Card.py Normal file
View File

@@ -0,0 +1,22 @@
class Card:
"""
Represents a playing card with a suit and value.
"""
def __init__(self, suit: str, value: str):
self._suit = suit
self._value = value
#Creates a Card object with the specified suit and value.
def get_suit(self) -> str:
return self._suit
#Returns the suit of the card.
def get_value(self) -> str:
return self._value
#Returns the value of the card.
def __repr__(self) -> str:
return f"{self._value} of {self._suit}"
#Returns a string representation of the card in the format "Value of Suit".