Created
August 28, 2023 19:35
-
-
Save nalgeon/88242fd822603290255877e396664ba5 to your computer and use it in GitHub Desktop.
Greetings in Python
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
class Greeter: | |
def __init__(self, greeting): | |
self.greeting = greeting | |
def greet(self, who): | |
print(f"{self.greeting}, {who}!") | |
gr = Greeter("Hello") | |
gr.greet("world") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment