I need to call a python function using a variable

前端 未结 0 949
灰色年华
灰色年华 2020-12-07 06:27

I need to call a function based off the value of a string variable.

mystrvar = \'a\'

def a():
  print("Hello, world!")

mystrvar()

相关标签:
回答
  • 消灭零回复
提交回复
热议问题