Skip to content
Permalink
master
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
# 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)