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

All Divisors of a Number in Python

In the previous article, we saw how we can determine a Prime Number using Python logic and syntax. In this article we will explore All Divisors of a Number in Python. Imagine that we have a tower of height 12 using equal size blocks, we need to find the size of all the blocks that … Read more

Optimized solutions in Python for All Divisors and Prime Number

In the previous article we explored programs for obtaining all divisors of a given number. Let us see the ways in which we can discuss optimize the programs in the previous article as well as the program for Prime Numbers. Optimizing programs in recent usage or legacy code is important as we gain new knowledge … Read more

Fibonacci Numbers in Python

In the previous article we explored the LCM Concept and two different ways we can obtain them, now we will look at what the Fibonacci numbers are and how they can be obtained or the way in which Fibonacci Numbers in Python are implemented. Let us look at a problem involving Fibonacci numbers: There are … Read more

LCM of two Numbers in Python

In the previous article we explored about GCD and it’s implementation in Python. Now let us explore the concept of LCM and how we can arrive at the LCM of two Numbers in Python. Before we delve further into Python let us look at a problem which can further/or revise our understanding of LCM. We … Read more

GCD of two numbers in Python

In the previous article, we explored two different approaches towards obtaining the factorial of a number. In this current article we will explore how we can obtain the GCD of two numbers in Python. The common divisor of several integers is a number that can be a divisor of each number in the specified set. For example, … Read more

Factorial Program in Python

In the previous article we have seen the logic and code for obtaining the count of the digits in a number, in this article we will see how we can obtain the Factorial of any user-entered number in Python. Before we discuss the Factorial Program in Python, let us revise the concept of Factorial. The … Read more