只用函数调用没有报错,加了一个类class serious_time:后,报错:TypeError: 'type' object is not iterable
怎么修改,确保类名,方法的方式调用正常
```python
class serious_time:
serious_time = []
for i in range(2, ws.max_row + 1):
if ws['D' + str(i)].value == 'Android' and ws['I' + str(i)].value == 'a':
serious_time.append(ws.cell(row=i, column=11).value * 24)
def serious_time_rate(self):
t = 0
for j in serious_time:
if j <= 24:
t = t + 1
if len(serious_time) == 0:
return '/'
else:
serious_time_rate = t / len(serious_time)
return "%.2f%%" % (serious_time_rate * 100)
if __name__ == '__main__':
print(serious_time.serious_time_rate())
```