Python — Basic Review before diving deeper 09
Want to recall the memory of Python easily?
This is the note taken when I learned Python “again”, hope it helps you too.
There are additional links in the article for you to understand further information.
BTW. I just start my journey with break-the-ice-with-python ☃️🔥
💠My solutions are here
Quick tip |
Find ⚡ for each topic
☘️Directory
🔹Error Handling
🔹Common types of exceptions
🔹Genertators & yields
❤️Good Resources
Bro code | Python full course
ZeroToMastery | Pyhton
Codes in Github
⚡Error Handling
More in GeeksforGeeks | Exception Handling
Error handling in W3Schools
When you encounter errors, you should try to Catch Specific exception.
🔸Those above can be classified as two types:
🔹Syntax errors
🔹Logical errors (Exceptions)
🔸Know there before diving deeper:
🔹Errors = problems in a program then it will stop the execution
🔹Catch Exceptions —
tryblock lets you test a block of code for errorsexceptblock lets you handle the error.finallyblock lets you execute code, regardless of the result of the try- and except blocks.
🔹Syntax —
More in W3Schools | Try Except
- Catch Specific exception
- Normal Catch Exception
- try with else clause
- finally keyword
- raise keyword
⚡Common types of Exceptions
🔹SyntaxError
🔹TypeError
🔹NameError
🔹IndexError
🔹ValueError
🔹AttributeError
🔹IOError
🔹KeyboardInterrupt
🔹ZeroDivisionError
🔹ImportError
Get Yen Wang’s stories in your inbox
Join Medium for free to get updates from this writer.
🔹ModuleNotFoundError
🔸Syntax Error
🔸Logical Errors(Exception)
Let’s see other errors.
🔸TypeError
🔸NameError
🔸IndexError
Example from pythonForBeginners
Wrong index number which is out of range.
🔸ValueError
More in Educative.io
🔸AttributeError
More in GeeksforGeeks
🔸IOError
More in pythonForBeginners
🔸KeyboardInterrupt
More in EDUCBA
🔸EOF Error
More in GeeksforGeeks
It happens when input hits the end of the file.
🔸ZeroDivisionError
More in learnShareIt
Literally, error occurs when the variable is divided by 0.
🔸TypeError
🔸ImportError
More in Educba
🔸ModuleNotFoundError
⚡Generators & Yield
More in realPython
🔸Yield
More in realPython
More in GeeksforGeeks
🔹yield will create a generator function
🔸First Example
⚡Exercise 13 — Fibonacci Numbers
More about Fibonacci Numbers








