Pavitra has Published 176 Articles

Python program to find sum of absolute difference between all pairs in a list

Pavitra

Pavitra

Updated on 26-Sep-2019 13:57:48

263 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a list input , we need to find the sum of absolute difference between all pairs in a list.Enumerate() method adds a counter to an iterable and returns it in a form ... Read More

Python Program to check whether it is possible to make a divisible by 3 number using all digits in an array

Pavitra

Pavitra

Updated on 26-Sep-2019 12:33:11

220 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven an array input of integers, we need to find whether it’s possible to make an integer using all the digits available in these numbers such that it would be divisible by 3.Here ... Read More

Python program to check if the given string is pangram

Pavitra

Pavitra

Updated on 26-Sep-2019 12:24:23

7K+ Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a string input, we need to generate a Python program to check whether that string is Pangram or not.A pangram is a sentence/ series of words which contains every letter in the ... Read More

Python program to check if a given string is number Palindrome

Pavitra

Pavitra

Updated on 26-Sep-2019 12:22:39

6K+ Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a string input, we need to create a python function to check whether it is a palindrome or not.A string is referred to be palindrome if the reverse of the string is ... Read More

Python Program to check if the given array is Monotonic

Pavitra

Pavitra

Updated on 26-Sep-2019 12:17:17

1K+ Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven an array input Arr containing n integers. We need to check whether the input array is Monotonic in nature or not.An array is said to be monotonic in nature if it is ... Read More

Python program to check if a string contains all unique characters

Pavitra

Pavitra

Updated on 26-Sep-2019 12:14:14

486 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a sring input, we need to find whether a string contains all unique characters or not.ApproachWe will create an array of boolean values, where the variable flag at the index i indicates ... Read More

Python Program to Check Armstrong Number

Pavitra

Pavitra

Updated on 26-Sep-2019 12:11:58

1K+ Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven an integer n , we need to check that the given integer is an armstrong number.A positive integer is called an Armstrong number of order n ifabcd... = a^n + b^n + ... Read More

Python Program for Sum of squares of first n natural numbers

Pavitra

Pavitra

Updated on 26-Sep-2019 12:04:49

649 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a positive integer N as input . We need to compute the value of 12 + 22 + 32 + ….. + N2.Problem statement:This can be solved by two methodsMultiplication addition arithmeticUsing ... Read More

Python Program for Smallest K digit number divisible by X

Pavitra

Pavitra

Updated on 26-Sep-2019 12:00:10

300 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementIntegers n and d are given. We need to find the smallest n-digit number divisible by d.Approach1. FirstNow let's we compute MIN : smallest n-digit number (1000...n-times)2. Now, If MIN % X is ... Read More

Simple interest in Python Program

Pavitra

Pavitra

Updated on 26-Sep-2019 11:56:50

193 Views

In this article, we will learn about the calculation of simple interest in Python 3.x. Or earlier.Simple interestis calculated by multiplying the daily interest rate by the principal amount by the number of days that elapse between the payments.Mathematically, Simple Interest = (P x T x R)/100Where, P is the ... Read More

Advertisements