12
Trong Python ai có thể làm:Tuyên bố từ điển giống như Python cho C#?
d = {1 : 'Hello', 2 : 'World'}
Trong C# nó tiết hơn:
Dictionary<int, string> d = new Dictionary<int, string>();
d.Add(1, 'Hello');
d.Add(2, 'World');
Làm thế nào tôi có thể làm cho điều này ít tiết?