このようなデータ構造を作成することは可能ですか?
w = {'London', 'Glasgow', 'Dublin' : 'rainy' , 'Paris', 'Berlin': 'cloudy', 'Tokyo', 'Montevideo' : 'sunny' }
(もちろん、上記には無効な構文があります)
私は書くことを避けたい:
w = {'London' : 'rainy' , 'Glasgow' : 'rainy', 'Dublin' : 'rainy' , 'Paris' : 'cloudy' , 'Berlin': 'cloudy', 'Tokyo' : 'sunny' , 'Montevideo' : 'sunny' }
それを短くして、各値の値に簡単にアクセスする方法はありますか?