我正在尝试使用索引创建因子列表。
n =int(input())
a=list()
b=list()
for i in range(1,n+1):
for j in range(1,i+1):
if i%j==0 :
b= b.append(j)
a=a.append(b)
print(a)
收到错误消息如下:
10
Traceback (most recent call last):
File "E:/Projects/Chatbot/assign1.py", line 23, in <module>
a=a.append(b)
AttributeError: 'NoneType' object has no attribute 'append'