Name

try

Examples
element_names = {'H': 'hydrogen', 'He': 'helium', 'Li': 'lithium'}

try:
  print(element_names['Zz'])
  
except KeyError as e:
  print("caught KeyError: " + e.message) # Prints 'caught KeyError: Zz'
Description
Syntax
try:
  tryStatements
except exception as tmpName:
  exceptStatements
Parameters
tryStatements
exception
tmpName
exceptStatements
Related except
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License