class Phone:
def __init__(self):
self.types = ["Touch Screen","Flip", "Slider", "Bar", "Bag"]
self.brand = "No Brand Determined"
self.type_of_phone = "No Type of Phone has been selected"
def get_type(self):
return self.type_of_phone
def change_type(self, changeTo):
if self.check_type(changeTo):
self.type_of_phone = changeTo
else:
print("The Type you wish to change the phone to is not a supported type.")
def change_brand(self, changeTo):
self.brand = changeTo
def check_type(self, inQuestion):
if inQuestion in self.types:
return True
return False
def toString(self):
return "Brand: "+self.brand+"\nType: "+self.type_of_phone+"\n"
def menu(self):
self.intro()
while True: …
Run Code Online (Sandbox Code Playgroud)