Name

: (Colon)

Examples
def exclaim(s, count): # A colon declares the start of an indented block.
  return s + ("!" * count)

# Any statements followed by indented lines should end with a colon.
for i in range(1, 6):  # And here
  print(exclaim("Python", i))
# Separates key/value pairs
element_names = {'H': 'hydrogen', 'He': 'helium', 'Li': 'lithium'}
print(element_names['H'])
Description
Related if
else
for
def
Dictionary
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License