question:
python2.7中print(end=' ')不能用?
anwser:
1、end='' 是python3 的语法,换python3
2、程序第一行添加from __future__ import print_function,错误会消失
本文介绍了解决Python2.7中使用print(end='')语法错误的方法:通过升级到Python3或在程序首行引入from __future__ import print_function来实现与Python3兼容的打印功能。
python2.7中print(end=' ')不能用?
1、end='' 是python3 的语法,换python3
2、程序第一行添加from __future__ import print_function,错误会消失

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