擅长:python、mysql、java
<p>区别在于<code>print</code>调用<code>str</code>,而REPL(read evaluate print loop)的默认操作是调用对象上的<code>repr</code>,除非它是{<cd4>}。在</p>
<p>请注意,如果您不在交互式解释器中工作(您不在REPL中),那么在没有<code>print</code>的版本中,您将看不到任何<em>输出。在</p>
<p>还请注意,输出之间存在差异。<code>repr</code>在字符串上添加引号。在</p>