AttributeError:'int'对象没有属性'popincrease'

时间:2018-11-16 17:24:21

标签: python-3.x

class city:
     def __init__(self,a,b,c):
         self.name=a
         self.state=b
         self.polpulation=c
     def display(self):
         print("anme of city ",self.name)
     def popincrease(self):
         self.polpulation+=self.polpulation/10

a=city("ddn","utt",10245)
a.display()

new_pop=a.polpulation.popincrease
print(new_pop) 

new_pop中的错误。请帮忙 无法理解该错误。尝试过类型转换。但此方法不起作用。

0 个答案:

没有答案