Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active May 31, 2022 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/61e95b5c7a8d697cb748cd49b43aab90 to your computer and use it in GitHub Desktop.
Save mcsee/61e95b5c7a8d697cb748cd49b43aab90 to your computer and use it in GitHub Desktop.
class Date:
def __init__(self, day, month, year):
self.day = day
self.month = month
self.year = year
def setMonth(self, month):
self.month = month
startDate = Date(3, 11, 2020)
# OK
startDate = Date(31, 11, 2020)
# Should fail
startDate.setMonth(13)
# Should fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment