python2:
在print末尾添加逗号即可 print 'string',
eg: print "this is tree",
python3 : print('string',end=' ')
本文介绍了在Python 2及Python 3中实现特定打印效果的方法。针对不同版本的Python,文章提供了如何在同一行内连续输出字符串的具体示例,帮助读者掌握在实际编程中灵活运用这些技巧。
python2:
在print末尾添加逗号即可 print 'string',
eg: print "this is tree",
python3 : print('string',end=' ')

被折叠的 条评论
为什么被折叠?