Monday, October 3, 2016

[ Exceptions & Files ] Exceptions

When exception occurs , the program immediately stops.


Different exceptions are raised for different reasons .

  • ImportError
  • IndexError => out of range of index
  • NameError => an unknown variable is used
  • SyntaxError 
  • TypeError => a function is called on a value of an inappropriate type.
  • ValueError => a function is called on a value of the correct type , but with an inappropriate value.

No comments:

Post a Comment