有我的清单:
fieldNames = ["Your Firstname","Year of birth", "Month of birth", "Day of Birth"]
birthValues = []
birthValues = multenterbox(msg, title, fieldNames)
yourName = birthValues[0]
yearBirth = birthValues[1]
monthBirth = birthValues[2]
dayBirth = birthValues[3]
我可以找到列表的长度: LEN(FIELDNAMES)
我的问题是我一直在列表中添加值。所以我需要能够自动获取下一个值的东西[4] [5] [6]等...
答案 0 :(得分:0)
你的意思是你想要一个循环,就像这样?
fieldNames = ["Your Firstname","Year of birth", "Month of birth", "Day of Birth"]
birthValues = multenterbox(msg, title, fieldNames)
mapping = dict()
for i in range(len(fieldNames)):
mapping[fieldNames[i]] = birthValues[i]
您可以使用mapping["Your Firstname"]
访问birthname。