我有一个可能很容易的问题,我似乎无法弄清楚如何。如何做这样的事情:如何打印字符串的值,而不是自己的字符串
race = goblin #I change the race here
goblingrowth = 200
humangrowth = 300
orgegrowth = 400
print (race + "growth") #In this case, it will print the string "goblingrowth" in
python, but I want it to print the value of the variable (goblingrowth),
which is 200, and i have to do it this way.
任何帮助,将不胜感激,谢谢你能做到这一点
考虑使用字典。 –