Returning multiple Variables in Python

In the previous article saw how parameters are passed and handled in Python, now we will look at how we can return multiple variables in Python. Here is an example program that returns two values: When we call the function we receive the two values from add_multiply, later the program prints out the value of …

Read more

Global Variables in Python

In the previous article we looked at how we can return multiple variables in Python. Now let us discuss about Global Variables in Python, Global variables are the variables declared outside of functions and classes and that are accessible throughout the entire program. Here in this article we will mainly look at the use of …

Read more

Variable Length Arguments in Python

In the previous article we have discussed keyword arguments, now we will look at another type of argument that can be provided to functions: Variable length arguments. Many times we want a functionality to be implemented for various different inputs. If we pass two, then we want sum of two variables. We want a sum …

Read more

Applications of Functions in Python

In the previous article we had a look at the basics of Functions, now let us look at the various areas within a program’s code or script that a Function would come in handy. Functions are an essential part of most programming languages. Functions are reusable pieces of code that can be called using a …

Read more

String Operations in Python Part 2

In the previous article we saw various string operations like concatenation, and use of index( ) and rindex( ) functions. Now we will look at more String Operations in Python. Utilizing String Operations in Python len( ): It returns the number of characters in the string. upper( ): It converts the lowercase characters in the …

Read more