Skip to content

Commit

Permalink
Basic
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjanaPurbia authored Sep 9, 2021
1 parent 509f874 commit 1f64bab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions inheritance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class sweetfruits:
taste="sweet"
def getTaste(self):
print("it tatse sweet")

class Apple(sweetfruits):
colour="red"
def details(self):
print("Name=Apple\nColor={}\nTaste={}".format(self.colour,self.taste))

obj=Apple()
obj.details()

0 comments on commit 1f64bab

Please sign in to comment.