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

Python Continue, Break, and Pass Keywords

In previous lessons, you learned about different types of loops such as for loop, while loop and for-each loop. Each of the loop terminate successfully. What if you want your loop to exit in between execution, or you want to skip some of the iterations. There are three keywords in python programming that does that … Read more

Python Nested Loops

A python nested loop is loop with in a loop. Python programming allows you to create such loops. Now the choice of loops is totally up to the programmer. You can for-loop inside for-loop, for-loop inside while-loop, while-loop inside a while and so on.Therefore, various combination of loop is possible with deep levels of nesting. … Read more

Python Type Casting

Casting means changing a data type to another. It is popular in many programming languages like C/C++, Java, etc. Python also supports the type casting and it is done using casting functions. In python, there are two primary casting operations you can do and they are: Change string to other types such as Integer, Float, … Read more