Skip to content
Permalink
3ef22fdb8c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
23 lines (14 sloc) 490 Bytes
# Accessing the attribute set in the parent class
class ballgames:
def __init__(self,name,avail,price):
self.name= name
self.avail= avail
self.price= price
# def sport(self):
return "{}{}{}".format(self.name,self.avail,self.price)
class indoor(ballgames):
pass
ballgames_1=indoor("basketball","weekdays",20)
ballgames_2=indoor("volleyball","weekends",15)
print (ballgames_1.avail)
print (ballgames_2.avail)