-
-
Save Vasanth375/747de7bc1e8ceb13dee1f704aa73a322 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
class Person: | |
def __init__(self, name, age): | |
self.name = name | |
self.age = age | |
def greet(self): | |
return "Hello, my name is " + self.name + " and I am " + str(self.age) + " years old." | |
p1 = Person("John", 30) | |
print(p1.greet()) # Output: "Hello, my name is John and I am 30 years old." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment