Final changes to Project 1 and Project 2

This commit is contained in:
2026-04-09 14:27:21 -04:00
parent a30e9b2556
commit 864d07348d
4 changed files with 6 additions and 2 deletions

BIN
Project 1/Project 1.pdf Normal file

Binary file not shown.

View File

@@ -32,8 +32,12 @@ class Card:
def __add__(self, other) -> int:
#Adding 2 cards together
if isinstance(other, Card):
return self.value + other.value
return self._value + other._value
elif isinstance(other, int):
#allows adding a card to an int
return self.value + other
return self._value + other
return NotImplemented
def __radd__(self, other) -> int:
return self.__add__(other)
#Added for project 2: Created an "__add__" meathod to allow adding Cards together.

BIN
Project 2/Project 2.pdf Normal file

Binary file not shown.