#python
Read more stories on Hashnode
Articles with this tag
The enumerate function is a built-in function in Python that allows you to loop over a sequence (such as a list, tuple, or string) and get the index...
If ... Else in One Line There is also a shorthand syntax for the if-else statement that can be used when the condition being tested is simple and the...
Raising Custom errors In Python, we can raise custom errors by using the raise keyword. salary = int(input("Enter salary amount: ")) if not 2000 <...
Finally Clause The finally code block is also a part of exception handling. When we handle exception using the try and except block, we can include a...
Exception Handling Exception handling is the process of responding to unwanted or unexpected events when a computer program runs. Exception handling...
Python - else in Loop As you have learned before, the else clause is used along with the if statement. Python allows the else keyword to be used with...