Python Exception Handling With Else

The else block in python is also part of the exception handling. The try block when finds an error, jumps to the catch block. However, we want some behavior when the try block itself is successful.The response code when the try block is successful is written in the else block. Note that the else block … Read more

Python Except Block

The python except block is the catch block in the exception handling mechanism. Any error or exception caught in the try block is caught by the python except block and response code is executed.In the previous article, you learned about the try block and in the article, we will explore the except block in details.Catching … Read more

Python Try Block

The python try block is part of python exception handling mechanism. The try block is similar to an if-then-else block. If an error occurs the try block stops executing. These errors are known errors for which we have a try block. They are called exceptions. The try block is to notice the error or exception … Read more

Error Handling Overview

In computer programs, some kind of errors are expected. We can simply read those errors and fix the problem. But some errors are bound to happen, usually related to user inputs or mismatch of specific conditions of the program. Since, we know them already and knows that it would occur in some point in time … Read more

Python Keyword Parameters

In earlier articles about function, we have used parameters and those parameters are replaced with some arguments when a function call takes place.In this article, you will learn about python functions that takes default values or called it named parameters.These named parameters have some values assigned to them. You can always override these default values. … Read more

Python Function Return NoneType

In the previous articles, you have seen various types of functions. Function either return a value or nothing. In this article, you will learn about functions that return a None. The None is the only value that belong to None Type.When Python Functions Return NoneThere are a number of situations when a python function returns … Read more

Python Function With Parameters, No Return

In the previous example, you have seen that python can take no parameter and return some value. In this example, you will learn that a function can take some parameter and output the results without returning the value.Python Program To Reverse a StringIn this example, we will accept a string as parameter and then reverse … Read more

Python Function With No Parameter, No Return

In the last article, we have seen how a user-defined function is created. The user-defined function has two parts – the function definition and the function call.The function definition may or may not have parameters and it may or may not return a value.In this article, you will see an example of python function with … Read more

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Exit mobile version