星期三, 3月 04, 2015

python 3.x print 用法

python 3.x 的 print 無法像 python 2.x 一樣的用法:
3.x: print('hello world')
2.x: print 'hello world'

如果不斷行
3.x: print('hello world', end='')  # 使用空白字元, 或是空字元代替
2.x: print 'hello world',             # 使用 , (逗點)

沒有留言: