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 … 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 None There are a number of situations when a python … Read more

Python Functions Common Errors

While writing a python function and using it in your program, you get lot of errors such typing wrong name of the function, changing the order of definition and function calls, wrong parameters, less parameters(parameter mismatch) and scope errors. Wrong Function Definition and Function Call Order In python programming one of the most common error … Read more

Python Functions With Parameters and Return

Python programming allows function to take some parameters and compute them and return a value. This is very efficient method of programming when it clearly defined what inputs a function will take and what output it returns. Python Program That Compute Sum Of Two Matrix In this example, we will create two matrix using lists … 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 String In this example, we will accept a string as parameter and … Read more

Python Functions

So far we have seen many programs which ran sequentially, means executed the lines of codes in a linear manner. We have also seen blocks of code such as if-then-else and loops such as for-loop and while-loop. In this article , you learn about python functions. Once thing is common to all of these codes, … 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