我有这个需要转换为小写的 Python 字典。字典包含需要与不区分大小写的输入相对应的数据,例如,它适用于 resp = 'GBR' 或 'gbr'。希望我在这里有意义。任何帮助将不胜感激!
resp = raw_input('Which country is ' + record['name'] + ' in? ')
print " "
valid = {'GBR': ['GBR',
'United Kingdom',
'UK',
'Great Britain and Northern Island',
'GB'
],
'IRL': ['IRL',
'Eire',
'Republic of Ireland'
]
}
if resp in valid[record['sov']]:
answ = 'Yes, ' + record['name'] + ' is in the ' + resp