Leap Year Program in Python

In the previous article we have seen the programs and logic relating to figuring out the largest of three numbers provided by user, in this article we will look at how to implement Leap Year logic in Python. Leap year is the year in which an additional day exists in February, and occurs about every … Read more

Largest of Three numbers program in Python

In the previous article we explored a problem involving a python game utilizing Even or Odd Logic, now we need to write a program to accept three numbers from the user and then automatically provide to us the largest of the three numbers. Suppose the user provides the program the numbers: a=10, b= 15, c=7 … Read more

Even-Odd problem in Python

Previously we have looked at the conditional statements in Python, In this article we will examine a problem related to even or odd concept. In this particular case of two examples imagine a game where you and your opponent are playing, and we are given a number of points. In the first example we have … Read more

if-else and elif statements in Python

In this article we will explore the If-else and elif statements in Python. These statements exist to execute code if certain conditional statements are satisfied. They can be very helpful for specific needs or tasks. For example while working on an online form, which requires the user to enter a username. The user has strongly … Read more

Bitwise Operators in Python

Sometimes we work with unusual digits or values which are involved in our program’s operations. One such case is when we work with Binary digits(bits) of integer values. Bitwise Operators in Python allow us to work or manipulate such data when required in our program. The Python language supports working with binary digits (bits) of … Read more

Days Before N Days in Python

In the previous article we explored the sum of Natural Numbers in Python. Suppose we are given some days, each number means a successive different day for example: Sunday represents 0, 1 represents Monday, 2 represents Tuesday, 3 represents Wednesday, 4 represents Thursday, 5 represents Friday, 6 represents Saturday. The program calculates the number of … Read more

Sum of Natural Numbers in Python

In the previous article we have explored Geometric Progression in Python. Now we will start looking at various common programs to further our understanding of Python such as Sum of Natural Numbers, Finding Last Digits or Days Before N number of Days. In this article we will explore the concept of Sum of Natural Numbers … Read more

Arithmetic Progression in Python

In the previous article we have explored the use of various membership operators in Python. Now we will look at the implementation of the Arithmetic Progression in Python. An arithmetic progression is a numerical sequence a 1 , a 2 , …, a n , … in which, for each natural n, the equality is satisfied. a n + 1 = a n + d, where … Read more

Identity Comparison Operators in Python

In the previous article we have gone through the logical operator concepts in Python, in this article will look at the identity comparison operators in Python. Identity or identity operators compare the location of two objects in memory and their relation with each other. Utilizing Identity Comparison Operators in Python In Python identity operators are used to determine whether … Read more