-
PROGRAMS
A prime number is a positive whole number greater than 1 which is evenly divisible only by 1 and itself. 2, 3, 5, 7, 11, 13 are the first few prime numbers.Some interesting facts about Prime numbers -2 is the only even prime number0 and 1 are not conside…
-
PYTHON
For any two positive integer number m and n, GCD ( greatest common divisor) is the largest integer number which divides them evenly.So for the following two numbers 8 and 12, 4 is the largest number which divides them evenly hence 4 is the GCD of 8 &…
-
PYTHON
A function is a block of organized, reusable code. Functions simplify the coding process, prevent redundant logic, and make the code easier to follow and allow you to use the same code over and over again.Creating clean, readable and reusable functions i…
-
PYTHON
Many objects in Python are iterable which means we can iterate over the elements of the object. Such as every element of a list or every character of a string.Loops facilitate programmers to iterate over a block of code at every iteration, in Python we c…
-
PYTHON
A guessing game is a classic and fun way to engage users and challenge their guessing skills. In this article, we will walk you through the process of creating a simple guessing game using Python. This game will randomly generate a number, and the user w…
-
PYTHON
Loops are an essential part of any programming language.Loops allow programmers to set certain portions of their code to repeat through a number of loops which are referred to as iterations.This article covers the construction and usage of While loops in…
-
PYTHON
In programming, oftentimes we want to execute a particular block of code only, and we might need to skip over some lines too. Conditional statements can help us to do so. Conditional Statements give us greater control over our program.With conditional st…
-
PYTHON
Every variable in Python has a Datatype. Although you don't declare them while using them declarations happen automatically when you assign a value to the variable.These datatypes play an essential role in programming because they determine what kind of …
-
PYTHON
In Python string is a sequence of characters wrapped in single or double quotation marks.Python comes with an in-built method of String class for string formatting. Python str.format() method allows us to do string formatting and substitution operations.…
-
PYTHON
In Python, variables are objects, data types are the classes and these variables are the instance of these classes.There are different kinds of data types in Python which specifies what kind of values can be assigned to a variable. We don't need to decl…