Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Python_programs

Sum of 2

Input: Array of number, Target number. Flow: print the two numbers in the array which will be added to get target number. Example: Enter List: 5 4 3 2 Enter the Target: 7 Numbers are 5 2 Numbers are 4 3

Sum of digit

Program to find given number sum of digit. Example: Enter a number: 1546 16

Power of 2

Program to check if the given number is power of 2 or not. Example: Enter a number: 64 Power of 2 Enter a number: 45 Not a Power of 2

Reverse of list

Program to reverse a list given. Example: Enter a list: 1 5 8 6 [6, 8, 5, 1]

Remove duplicate

Program to remove the duplicate value in the list. Example: Enter a list: 1 2 3 4 5 1 2 3 4 5 6 After removing duplicate: [1, 2, 3, 4, 5, 6]

Prime number

Program to find a given number is prime or not.

First unique

Program to find the first unique letter in the given word. Example: Enter a word: prompt The unique first letter - r

Fibanooci

Program to print the given number of Fibanooci series. Example: Enter a number: 7 [0, 1, 1, 2, 3, 5, 8]

Binary search

Program to search an given number in the list by binary search using function. Example: Enter list: 1 5 7 9 10 Enter key: 9 Key found at 4

Anagram

Program to check if the two words are anagram Eg: Silent,Listen are anagram

Intersection

Program to find the same elements in the two list given. Example: Enter first list: 1 5 8 3 Enter second list: 2 4 5 9 [5]

Max of subarray

Program to find the subarray from the given array which add up to the target. Example:Enter the list: 1 2 3 4 5 Enter the target: 9 [2, 3, 4] [4, 5]

Merge list

Program to merge and sort the two given list. Example: Enter a list 1: 12 45 85 Enter a list 2: 14 65 88 ['12', '14', '45', '65', '85', '88']

No of 1 in bits

Program to find the 1's in the bits given. Example: Enter a number: 7 The no of 1 in bit representation 3

Pali

Program to find the given word is palindrome or not. Example: Enter a String: madam Given String is palindrome

Palindrome

Program to find given number is palindrome or not. Example: Enter a number to palindrome or not: 54 Not a Palindrome

Armstrong number

Program to check given three digit number is palindrome or not. Example: Enter a three_digit number:153 Given no is armstrong no

Sorting without built-in function

Program to sort the list without built-in function.

Peak number

Program to find the peak number which their adjacent number is lesser than the number. Example: Enter a list: 2 5 4 8 3 1 Peak no: 5 8

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages