擅长:python、mysql、java
<p>您的错误非常简单,尽管在代码开头声明了以下列表:</p>
<pre><code>ekt=[]
pl=[]
nm=[]
</code></pre>
<p>接下来要做的是使用这些非常相同的变量名来捕获输入:</p>
<pre><code>nms=raw_input("Ποιο το όνομα της χώρας?")
ekts=input("Ποια η εκταση της χώρας αυτής?")
pls=input("Ποιός είναι ο πληθυσμός της χώρας αυτής?")
</code></pre>
<p>但您并不是在原始列表上追加,代码是这样的:</p>
<pre><code>nms.append(ekt)
ekts.append(ekt)
nms.append(nm)
</code></pre>
<p>但是<code>nms</code>不是原始列表,您的原始列表称为<code>nm</code>,<code>nms</code>是您刚刚读取的字符串。另外<code>ekt</code>是您试图附加的值,它不是您读取的字符串(称为<code>ekts</code>),<code>ekt</code>是您在代码开头声明的列表。因此,基本上,您试图将列表附加到字符串对象,但这是无法完成的。同样的事情也适用于下面的行,请重新检查变量的名称</p>