我不知道如何把这个放进去,所以我直接举一个例子
month1=31
month2=28
month3=31
month4=30
#number of days in certain months
monthnumber=3
# I want to find the number of days in the third month
monthnumberstr=str(monthnumber)
daysinmonth=("month"+monthnumberstr)
print(daysinmonth)
Run Code Online (Sandbox Code Playgroud)
现在我期待它打印31但我得到month3作为输出.如何使输出成为变量的变量.我再也不知道该怎么说.我只想要输出为31,而不是month3