Niharika Aitam has Published 168 Articles

Python program to check if number is palindrome (one-liner)

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:59:04

153 Views

Generally, palindrome is a word, phrase, number, or other sequence of characters that reads the same forwards and backwards. In the context of a Python program, a palindrome usually refers to a string or number that remains the same when its characters or digits are reversed. For example, let’s consider ... Read More

Python Program to check if elements to the left and right of the pivot are smaller or greater respectively

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:56:54

34 Views

Generally, pivot table is the table which contains the grouped values formed by aggregating the individual elements within one or more discrete categories. In Python, the term "pivot" is often associated with sorting algorithms or operations that involve rearranging elements based on a specific value or condition. The pivot can ... Read More

Python Program to check date in date range

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:43:57

768 Views

In this article we will learn how to check if the given input date falls in the specified date range or not. There are ways to do so; some of them are explained in detail. Using the datetime module Datetime module offers classes to manipulate the dates and times. This ... Read More

Python program to Check all strings are mutually disjoint

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:41:20

41 Views

String is one of the data structures which hold the data enclosed in double quotes or in single quotes i.e. any data type enclosed inside the quotes considered as string. It is immutable, once we define the data we cannot change or modify. In python we have a function called ... Read More

Python program to change the value of a dictionary if it equals K

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:38:42

30 Views

Dictionary is one of the data structure available in python to store any datatype of data in the format of key and value pair. It is denoted by {} curly braces. The key in the dictionary is unique and the values in the dictionary can be repeated. The key and ... Read More

Python program to calculate gross pay

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:36:00

135 Views

Basically Gross pay is the total amount paid to an employee for the total time he/she worked, i.e. this is the full amount of salary of an employee before the taxes and deductions. The Gross pay also includes the bonuses, overtime or reimbursements from an employer on top of the ... Read More

Python program to calculate square of a given number

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:27:05

170 Views

Square is the defined as the multiplication of the number by itself. The square of a number n is given as n2. Mathematically we can implement square of the number as follows. $\mathrm{n^{2}=n*n}$ In the same way we can calculate the square of a given number by using python language ... Read More

Python program to calculate Date, Month and Year from Seconds

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:23:07

164 Views

Generally, time is given in hours or minutes or seconds and from the given seconds, we can calculate the number of days, months and years. There are different modules and functions available in python such as datetime, time and divmod() which helps us to calculate the date month and year ... Read More

Python program to calculate age in year

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:20:56

3K+ Views

Generally, the age of a person is calculated by subtracting the birth year with the current year then the age of the person will be generated in years. In the same way we can calculate the age of a person by using the python modules datetime, dateutil and timedelta. General ... Read More

Python program to calculate acceleration, final velocity, initial velocity and time

Niharika Aitam

Niharika Aitam

Updated on 19-Oct-2023 14:17:19

479 Views

Acceleration, final velocity, initial velocity and time are the terms related to physical science which are widely used to study the motion and mechanics. Let’s see each one in detail. Acceleration Acceleration is the rate at which an object changes its velocity over the given time. It is denoted ... Read More

Previous 1 ... 4 5 6 7 8 ... 17 Next
Advertisements