Professional Documents
Culture Documents
class Smartphone:
# constructor for this class
# if name is not passed it is by default
# equal to None
def __init__(self, name=None) -> None:
# initialize features as dictionary
self.features = dict()
# initialize smartphone_name = name
self.smartphone_name = name
# printDetail function
def printDetail(self):
# check if smartphone_name is found or not
# in case it is none give error message and return
if(self.smartphone_name==None):
print("Cannot display phone info without phone name")
return