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 = {}

# Curly braces with values-only create a new set
element_set = {'H', 'He', 'Li'}
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.

Curly braces are also used to define "sets," or a series of unique keys without values, separated by commas. This is not to be confused with using set() on a pixel.
Syntax
	dict = {key0: val0, ..., keyN: valN}
	set = {key0, key1, ..., keyN}
Parameters
key0: val0, ..., keyN: valNa sequence of key/value pairs
key0, key1, ..., keyNa sequence of unique keys
Related [] (Index brackets)
set()
Updated on Fri Aug 16 21:51:57 2019.
Creative Commons License