Advertisement
Draqun

pa_handling_exceptions

Nov 12th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import sys
  3.  
  4.  
  5. def iterate(text: str):
  6.     for char in text.get_value():
  7.         print(char)
  8.  
  9.  
  10. try:
  11.     iterate("Some text to iterate")
  12. except AttributeError:
  13.     print("Oooops there is some AttributeError", file=sys.stderr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement