fork download
  1. try:
  2. x = float('abc123')
  3. print('The conversion is complete.')
  4. except IOError:
  5. print('This code caused an IOError.')
  6. except ValueError:
  7. print('This code caused a ValueError.')
  8.  
  9. print('The end.')
Success #stdin #stdout 0.02s 9056KB
stdin
Standard input is empty
stdout
This code caused a ValueError.
The end.