From e41b77e26c5060825076569923f2347ec0c0336a Mon Sep 17 00:00:00 2001 From: chadhumble Date: Sun, 14 Jan 2024 15:23:12 -0700 Subject: [PATCH] Added to Ch1_definition_start --- .vscode/settings.json | 1 - Start/Ch 1/definition_start.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 32dee9a..e348c9a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,7 +17,6 @@ "files.autoSave": "afterDelay", "screencastMode.onlyKeyboardShortcuts": true, "terminal.integrated.fontSize": 18, - "workbench.activityBar.visible": true, "workbench.colorTheme": "Default Light Modern", "workbench.fontAliasing": "antialiased", "workbench.statusBar.visible": true, diff --git a/Start/Ch 1/definition_start.py b/Start/Ch 1/definition_start.py index c519fd0..6cbf5d9 100644 --- a/Start/Ch 1/definition_start.py +++ b/Start/Ch 1/definition_start.py @@ -3,9 +3,16 @@ # TODO: create a basic class - +# The __init__ is also known as the initializer function in Python. +# It is the first thing that is called in a class before other functions. +class Book: + def __init__(self, title): + self.title = title # TODO: create instances of the class - +book1 = Book("Brave New World") +book2 = Book("War and Peace") # TODO: print the class and property +print(book1) +print(book1.title) \ No newline at end of file