我有一個可能很容易的問題,我似乎無法弄清楚如何。如何做這樣的事情:如何打印字符串的值,而不是自己的字符串
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.
任何幫助,將不勝感激,謝謝你能做到這一點
考慮使用字典。 –