Extend it:
For this challenge you will need to use exception handling to catch common run time errors
Challenges:
- Use
try
andexcept
around some code which tries to convert user input to an integer
Hint: Surround a section of code which uses the
int
function to convert a string to an integer with try…except… - Use
try
andexcept
around some code which tries to convert user input to an real/float
Hint: Surround a section of code which uses the
float
function to convert a string to an float / real with try…except… - Use try and except around some code which tries to open a file
Hint: Surround a section of code which uses the
open
function with try…except…
Page 1: Intro
Page 2: The theory: learn what you need to know as fast as possible.
Page 3: Try it: try out and adapt some working python code snippets.
Page 4: Debug it: Learn how to find and fix common mistakes.
Page 5: Extend it: Choose a project idea to use your newfound python skills.