Skip to content

Instantly share code, notes, and snippets.

@nalgeon
Created August 28, 2023 19:35
Show Gist options
  • Save nalgeon/88242fd822603290255877e396664ba5 to your computer and use it in GitHub Desktop.
Save nalgeon/88242fd822603290255877e396664ba5 to your computer and use it in GitHub Desktop.
Greetings in Python
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