Question
Modify your original program to import the functions from the file you just created and get everything working properly. #create class Shirt class Shirt: #constructor
Modify your original program to import the functions from the file you just created and get everything working properly.
#create class Shirt class Shirt: #constructor for initializing attributes of class def __init__(self,size,color): self.size=size self.color=color #print attributes of class def printAttributes(self): print("Size is "+str(self.size)) print("Color is "+self.color) #create instance of Shirt class shirt1=Shirt(35,"blue") print("Size is "+str(shirt1.size)) print("Color is "+shirt1.color) shirt1.printAttributes() shirt2=Shirt(40,"green") print("Size is "+str(shirt2.size)) print("Color is "+shirt2.color) shirt2.printAttributes()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started