class EPL_Team:
def __init__(self, name, song = "No Slogan", title = 0):
self.name = name
self.song = song
self.title = title
def increaseTitle(self, title = 0):
self.title = title
self.title +=1
def changeSong(self, song):
self.song = song
def showClubInfo(self):
print("Name:", self.name, "|", "Song:", self.song, "\nTotal No of Title: ", self.title)
manu = EPL_Team('Manchester United','Glory Glory Man United')
chelsea = EPL_Team('Chelsea')
print('=====')
print(manu.showClubInfo())
manu.increaseTitle()
print(manu.showClubInfo())
print('=====')
print(chelsea.showClubInfo())
chelsea.changeSong('Keep the blue flag flying high')
print(chelsea.showClubInfo())
print('=====')
my output:
=====
Name: Manchester United | Song: Glory Glory Man United
Total No of Title: 0
None
Name: Manchester United | Song: Glory Glory Man United
Total No of Title: 1
None
=====
Name: Chelsea | Song: No Slogan
Total No of Title: 0
None
Name: Chelsea | Song: Keep the blue flag flying high
Total No of Title: 0
None
=====
The output should be:
=====
Name: Manchester United | Song: Glory Glory Man United
Total No of title: 0
Name: Manchester United | Song: Glory Glory Man United
Total No of title: 1
=====
Name: Chelsea | Song: No Slogan
Total No of title: 0
Name: Chelsea | Song: Keep the blue flag flying high
Total No of title: 0
=====