Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> try:
- ... x = int("a lot")
- ... except items["error"] as e:
- ... # Same as except ValueError as e
- ... print("Couldn't convert")
- >>> try: ... x=int("a lot") File "<stdin>", line 2 x=int("a lot")
- ^
- IndentationError: expected an indented block
- >>> items = {}
- >>> items["error"] = ValueError
- >>> try:
- ... x = int("a lot")
- ... except items["error"] as e:
- ... print "Couldn't convert"
- ...
- Couldn't convert
- >>> try:
- ... x = int("a lot")
- ... except items["error"] as e:
- ... print("Couldn't convert")
Add Comment
Please, Sign In to add comment