而不是手动编写:
var1 = input("Whats your number")
var2 = input("Whats your number")
var3 = input("Whats your number")
...
var100 = input("Whats your number")
我可以使用for循环吗?
我试过但不行:
for x in range(1,100):
var = "var" + str(x)
"var" + str(x) = input("Whats your number")
print("var" + str(x))
SyntaxError:无法分配给运算符