【发布时间】:2020-08-28 15:11:40
【问题描述】:
我需要为 Python 2 print('-')*80 找到 Python 3 命令的等效项。我尝试在 Python 3 中运行 print('-')*80,但收到错误消息。
【问题讨论】:
-
我得到“TypeError: unsupported operand type(s) for *: 'NoneType and 'int'
-
背景阅读:realpython.com/python-print/#print-was-a-statement-in-python-2。在我看来,Python2 中的行为非常令人遗憾。
标签: python python-3.x python-2.x