我的代碼是這樣的:爲什麼Python中的函數字典自動執行自己?
def quick():
print "dex is 1"
def strong():
print "str is 1"
def start():
suffix = {"quick" : quick(), "strong" : strong()}
suffix.get("quick")
start()
然後我執行這個文件。結果變成:
dex is 1
str is 1
看來我的dict.get()在這裏工作不好,爲什麼?如何解決它?