Augh, dicts and other things.
Jul. 18th, 2013 01:03 pmGoddammit. I could do this in Python in two seconds, but C# is thwarting me.
In Python:
Output:
But how do I do this well in C#?
( Context. )
( [eta] Current implementation. )
In Python:
countryInfo = { 'Australia': { 'id': '13', 'pre': '61', 'len': '9' }, 'Spain': { 'id': '207', 'pre': '34', 'len': '9' } } country = "Spain" print "The prefix for %s is %s" % (country, countryInfo[country]["pre"])
Output:
The prefix for Spain is 34
But how do I do this well in C#?