我是 Python 新手,所以提前道歉。这是我遇到问题的代码:
x = 1
v1 = "First"
v2 = "Second"
v3 = "Third"
v4 = "Forth"
v5 = "Fifth"
v6 = "Sixth"
v7 = "Seventh"
v8 ="Eighth"
v9 = "Ninth"
v10 = "Tenth"
for x in range (1,11):
print("v"+str(x))
这是返回的结果:
v1
v2
v3
v4
v5
v6
v7
v8
v9
v10
这就是我希望返回的结果是:
First
Second
Third
Fourth
Fifth
Sixth
Seventh
Eighth
Ninth
Tenth
我如何打印越来越多的命名变量的内容?