These are a couple exercises to kick you off with Python
Create a new directory in your working dir for the class:
$ mkdir pushups $ cd pushups
Add a new file to it called
break_me.pyIn the
break_me.pyfile write four simple Python functions:- Each function, when called, should cause an exception to happen
- Each function should result in one of the four most common exceptions you'll find.
- for review:
-
NameError-TypeError-SyntaxError-AttributeError
(hint -- the interpreter will quit when it hits a Exception -- so you can comment out all but the one you are testing at the moment)
- Use the Python standard library reference on Built In Exceptions as a reference