擅长:python、mysql、java
<p>使用Python3内置的字符串格式,您可以并排打印它们(这就是我从您的问题中了解到的)。在</p>
<pre><code>print('{name1}:{health1} \t\t\t\t\t {name2}:{health2}'.format(name1=str(dice1 + dice2 + dice3),health1=attacker_health,name2=str(dice4 = dice5),health2=defender_health))
</code></pre>
<p>在上面的解决方案中,<code>{}</code>中的所有内容都是变量的占位符,变量作为<code>format</code>方法的关键字参数提供。希望这有帮助。在</p>