摘要: 在python3.0以后的版本中,raw_input和input合体了,取消raw_input,并用input代替,所以现在的版本input接收的是字符串,你可以用:x = int(input("x: "))x = input("input x:")print(int(x)+1) 阅读全文
posted @ 2013-03-04 19:22 helloweworld 阅读(281) 评论(0) 推荐(0) 编辑
摘要: def funName(x): print("call funName") return (x + 1) 阅读全文
posted @ 2013-03-04 14:37 helloweworld 阅读(108) 评论(0) 推荐(0) 编辑
摘要: for eachNum in [0, 1, 2]: print(eachNum)#range()内建函数生成0 1 2... for eachNum in range(3): print(eachNum) foo = 'abc'for c in foo: print(c)输出:012012abc 阅读全文
posted @ 2013-03-04 13:50 helloweworld 阅读(176) 评论(0) 推荐(0) 编辑
摘要: counter = 0while counter < 3: print(counter) counter += 1 print(counter) 阅读全文
posted @ 2013-03-04 13:35 helloweworld 阅读(231) 评论(0) 推荐(0) 编辑