Created
October 30, 2017 03:03
-
-
Save anonymous/2f2221c3b89040bceff57073dd552aaa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Store the next available id for all new notes | |
last_id = 0 | |
class Note: | |
def __init__(self, memo, tags=''): | |
'''initialize a note with memo and optional | |
space-separated tags. Automatically set the note's | |
creation date and a unique id.''' | |
self.memo = memo | |
self.tags = tags | |
self.creation_date = datetime.date.today() | |
global last_id | |
last_id += 1 | |
self.id = last_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment