- 博客(2)
- 收藏
- 关注
原创 2021-10-05 python:AttributeError: ‘NoneType‘ object has no attribute ‘append‘
Traceback (most recent call last): File "D:\C world\py\实验03.py", line 36, in <module> APPEND=APPEND.append(random.randint(1,100000))AttributeError: 'NoneType' object has no attribute 'append'把 APPEND=APPEND.append(random.randint(1,1000...
2021-10-05 20:23:05 120 2
转载 python中for......else......的使用
for x in range(5): if x == 2: print(x) # breakelse: print("执行else....")上述代码:当缺少break关键字时,程序的执行结果是:2执行else....当具备break关键字时,程序执行结果为: 2总结:for......else......的执行顺序为:当迭代对象完成所有迭代后且此时的迭代对象为空时,如果存在else子句则执行else子句,没...
2021-10-05 14:23:07 78
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人