擅长:python、mysql、java
<p>您希望将字符串与整数连接,但这是不可能的。您应该将整数转换为字符串,如下所示:<code>str(value1)</code></p>
<p>但是,使用字符串的<code>.format()</code>方法更有效。此方法自动将整数类型强制转换为str</p>
<p>就你而言:</p>
<pre><code>choice1=input("Your Value is: \n{}\nYou would like to make it your Intelligence,Attack Or Defence level? ".format(value1))
</code></pre>
<p>或者,如果使用<code>Python 3.6+</code>,也可以使用格式化字符串。起始<code>f</code>字符表示格式化的字符串</p>
<p>就你而言:</p>
<pre><code>choice1=input(f"Your Value is: \n{value1}\nYou would like to make it your Intelligence,Attack Or Defence level? ")
</code></pre>
<p>您可以在此页面上找到几种Python字符串格式:<a href="https://realpython.com/python-string-formatting/" rel="nofollow noreferrer">https://realpython.com/python-string-formatting/</a></p>