Python中使用“大括号”来定义字典。字典是一种将一个值映射到另一个值的数据结构,就像英语词典如何将单词映射到其定义一样。
蟒蛇:
dict = { "a" : "Apple", "b" : "Banana",}它们还用于格式化字符串,而不是使用%的旧C样式,例如:
ds = ['a', 'b', 'c', 'd']x = ['has_{} 1'.format(d) for d in ds]print x['has_a 1', 'has_b 1', 'has_c 1', 'has_d 1']它们不用于表示代码块,因为它们在许多“类似于C”的语言中。
C:
if (condition) { // do this}


