Name

{} (Curly braces)

Examples
# Initialize a new dictionary with the given key/value pairs
element_names = {'H': 'hydrogen', 'He': 'helium', 'Li': 'lithium'}

# Curly braces with nothing inside creates an empty dictionary
nothing_here = {}
Description Curly braces are used to define "dictionary literals," giving you the ability to declare a dictionary and its contents inside your program. A dictionary literal consists of a series of key/value pairs, written with a colon (:) between them, and with each of the key/value pairs separated from one other with commas.
Syntax
	dict = {key0: val0, ..., keyN: valN}
Parameters
key0: val0, ..., keyN: valNa sequence of key/value pairs
Related [] (Index brackets)
Updated on Tue Jul 11 06:52:23 2017.
Creative Commons License