摘要: 第一种:利用str()函数将数字转化成字符串,再利用len()函数判断位长。 1 a=Int(raw_input("the number you want type in:") 2 b=len(str(a)) 3 print b 第二种:利用除10取商,通过循环次数判断位数。 1 c=0 2 a=int(raw_input("the number you want type i... 阅读全文
posted @ 2016-12-05 11:29 Zhong_Leo 阅读(20347) 评论(0) 推荐(1)
摘要: 1 # drawSnake 2 import turtle 3 def drawSnake(rad,angle,len,neckrad): 4 for i in range(len): 5 turtle.circle(rad,angle) 6 turtle.circle(-rad,angle) ... 阅读全文
posted @ 2016-12-05 10:01 Zhong_Leo 阅读(318) 评论(0) 推荐(0)