Created
August 9, 2019 14:56
-
-
Save tarunasolanki/5bcb6667cfda5f5a7ce4ab67c740ddc7 to your computer and use it in GitHub Desktop.
Class And Objects 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 Person: | |
def __init__(self, name, age): | |
self.name = name | |
self.age =age | |
def myfunct(self): | |
print("Printed by mufunct") | |
print("Hello !! My name is ",self.name) | |
print("I am ",self.age," years old.") | |
print("Printed by object") | |
p1 = Person("Taruna", 19) | |
print(p1.name) | |
print(p1.age) | |
p1.myfunct() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment