可以了大大 谢谢你
想再请教你一个问题,我先前已经建立一个Movie class,如果我想在我的code里面getPriceWithGST() 该怎么做?
class Movie:
def __init__(self,name,category,description,price):
self.__name=name
self.__category=category
self.__description=description
self.__price=price
def getName(self):
return self.__name
def setName(self,name):
self.__name=name
def getCategory(self):
return self.__category
def setCategory(self,category):
self.__category=category
def getDescription(self):
return self.__description
def setDescription(self,description):
self.description=description
def getPrice(self):
return self.__price
def setPrice(self,price):
self.__price=price
def getPriceWithGST(self):
result=self.__price*1.07
return result
如果我想在我的code里面getPriceWithGST() 该怎么做?
Question:
Note:getPriceWithGST() Example: i. E.g. Price of movieis $10, price with GST would be $10 x 1.07 = $10.7 ii. Call this function in your code to display price with GST.
|