Skip to content

Instantly share code, notes, and snippets.

@nalgeon
Created August 28, 2023 19:35
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 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