摘要:
python提示AttributeError: 'NoneType' object has no attribute 'append' Python问题——AttributeError: 'NoneType' object has no attribute 'append' 把lt= lt.appe 阅读全文
摘要:
#AutoTraceDraw.pyimport turtle as tt.title('自动轨迹绘制')t.setup(800, 600, 0, 0)t.pencolor("red")t.pensize(5)#数据读取datals = []f = open("data.txt")for line i 阅读全文
摘要:
Python中for循环搭配else的陷阱 假设有如下代码: for i in range(10): if i == 5: print 'found it! i = %s' % i else: print 'not found it ...' 你期望的结果是,当找到5时打印出: found it! 阅读全文
摘要:
#A:起始,B:中间,C:最后count=0def hanoi(n,A,B,C): global count if n==1: print("{}:{}->{}".format(1,A,C)) count+=1 else: hanoi(n-1,A,C,B) #将前n-1个盘子从A移动到B上 prin 阅读全文