擅长:python、mysql、java
<p>您已经在迭代项目sp,您可以只使用变量,而不使用<code>str</code>作为变量名:</p>
<pre><code>async def queue(ctx):
counter = 1
print(song_names)
for mystr in song_names:
await ctx.channel.send(str(counter) + mystr)
counter += 1
</code></pre>
<p>看起来你需要<code>enumerate()</code>:</p>
<pre><code>async def queue(ctx):
print(song_names)
for index, mystr in enumerate(song_names):
await ctx.channel.send(str(index+1) + mystr)
</code></pre>