class MyClass(object):
my_list = []
def __init__(self, initial_list):
self.my_list = initial_list
def button_1(self):
self.my_list = [ele + 5 for ele in self.my_list]
print(self.my_list)
def button_2(self):
self.my_list = [ele + 10 for ele in self.my_list]
print(self.my_list)
这样有用吗?你知道吗
结果:
相关问题 更多 >
编程相关推荐