0% found this document useful (0 votes)
23 views

Unsolved python problems

Unsolved python problems
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Unsolved python problems

Unsolved python problems
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Unsolved python problems

( pyGuru )

YouTube : https://youtube.com/c/pyGuru

Telegram : https://t.me/pyGuru

Here is the listing of Python Topics in this pdf

Simple Python Programs

Python Programs on Numbers

Factorial & Fibonacci Programs in Python

Conversion Programs in Python

Pattern Programs in Python

Python Programs on Math Functions

Python Programs on Progression Series

Python Programs on GCD and LCM

Python Programs on Strings

Python Programs on Dictionary


Python Programs on Tuples

Python Programs on Classes & Objects

Python Programs on File Handling

Python Programs on List

Python Programs on Linked List

Python Programs on Singly Linked List

Python Programs on Doubly Linked List

Python Programs on Stack

Python Programs on Queue

Python Programs on Tree

Python Programs on Heap

Python Programs on Graph

Python Programs on Searching

Python Programs on Sorting

Python Programs on Gaming

Python Greedy Algorithms

Python Programs on Dynamic Programming


Simple Python Programs

Python Program to Check Whether a Given Number is Even or Odd Recursively

Python Program to Check if a given Integer is Positive or Negative

Python Program to Print Odd Numbers Within a Given Range

Python Program to Check if a Number is a Palindrome

Python Program to Reverse a Given Number

Python Program to Print all Integers that Aren’t Divisible by Either 2 or 3 & Lie between 1 & 50

Python Program to Find Numbers which are Divisible by 7 and Multiple of 5 in a Given Range

Python Program to Print all Numbers in a Range Divisible by a Given Number

Python Program to Compute the Sum of Digits in a given Integer

Python Program to Find Sum of Digits of a Number using Recursion

Python Program to Find the Sum of Digits in a Number without Recursion

Python Program to Count the Number of Digits in a Number

Python Program to Generate all the Divisors of an Integer

Python Program to Find the Smallest Divisor of an Integer

Python Program to Print Binary Equivalent of an Integer using Recursion

Python Program to Find the Binary Equivalent of a Number without Using Recursion

Python Program to Print Table of a Given Number

Python Program to Take in the Marks of 5 Subjects and Display the Grade

Python Program to Check if a Date is Valid and Print the Incremented Date if it is

Python Program to Find if a given Year is a Leap Year


Python Program to Read Height in Centimeters and then Convert the Height to Feet and Inches

Python Program to Read a Number n and Compute n+nn+nnn

Python Programs on Numbers

Python Program to Find Prime Numbers in a given Range

Python Program to Check if a given Number is Prime number

Python Program to Find whether a Number is Prime or Not using Recursion

Python Program to Check whether a given Number is Perfect Number

Python Program to Check whether a given Number is Armstrong

Python Program to Find the Sum of First N Natural Numbers

Python Program to Check if a Number is a Strong Number

Python Program to Print Numbers in a Range (1,upper) Without Using any Loops

Python Program to Read a Number n and Print the Natural Numbers Summation Pattern

Python Program to Compute Prime Factors of an Integer

Python Program to Check Whether the Entered Number is a Amicable Number or Not

Python Program to Find Whether a Number is a Power of Two

Python Program to Find Power of a Number using Recursion

Python Program to Find Product of 2 Numbers using Recursion

Python Program to Find all Numbers in a Range which are Perfect Squares and Sum of all Digits in the
Number is Less than 10

Python Program to Accept Three Digits and Print all Possible Combinations from the Digits
Factorial & Fibonacci Programs in Python

Python Program to Find Fibonacci Numbers using Recursion

Python Program to Find the Fibonacci Series without Using Recursion

Python Program to Find the Factorial of a Number using Recursion

Python Program to Find the Factorial of a Number Without Recursion

Conversion Programs in Python

Python Program to Convert Binary Code to Gray Code

Python Program to Convert Gray Code to Binary Code

Python Program to Generate Gray Codes using Recursion

Python Program to Perform Celsius to Fahrenheit Conversion

Pattern Programs in Python

Python Program to Print an Inverted Star Pattern

Python Program to Print the Pascal’s Triangle


Python Programs on Math Functions

Python Program to Find out the Roots of a Quadratic Equation

Python Program to Find the Area of a Triangle Given Three Sides

Python Program to Calculate the Simple Interest

Python Program to Read Two Numbers and Print Their Quotient and Remainder

Python Program to Determine all Pythagorean Triplets in the Range

Python Program to Compute a Polynomial Equation

Python Program to Swap 2 Numbers Without Using a Temporary Variable

Python Program to Count Set Bits in a Number

Python Program to Clear the Rightmost Set Bit of a Number

Python Program to test Collatz Conjecture for a Given Number

Python Program to Find the Gravitational Force Acting Between Two Objects

Python Program to Form an Integer that has the Number of Digits at Ten’s Place and the Least
Significant Digit of the Entered Integer at One’s Place

Python Program to Print an Identity Matrix

Python Programs on Progression Series

Python Program to Find the Sum of Series 1 + 1/2 + 1/3 + 1/4 + ……. + 1/N

Python Program to Find the Sum of the Series 1/1!+1/2!+1/3!+…1/N!

Python Program to Find the Sum of the Series: 1 + x^2/2 + x^3/3 + … x^n/n

Python Program to Read a Number n And Print the Series “1+2+…..+n= “

Python Program to Find the Sum of Sine Series


Python Program to Find the Sum of Cosine Series

Python Programs on GCD and LCM

Python Program to Find the LCM of Two Numbers

Python Program to Find the GCD of Two Numbers

Python Program to Find the GCD of Two Numbers Using Recursion

Python Program to Find the LCM of Two Numbers Using Recursion


Python Programs on Strings

Python Program to Check if a String is a Pangram or Not

Python Program to Remove the Characters of Odd Index Values in a String

Python Program to Remove the nth Index Character from a Non-Empty String

Python Program to Replace all Occurrences of ‘a’ with $ in a String

Python Program to Take in a String and Replace Every Blank Space with Hyphen

Python Program to Reverse the String using Recursion

Python Program to Reverse a String without using Recursion

Python Program to Determine How Many Times a Given Letter Occurs in a String Recursively

Python Program to Calculate the Length of a String Without Using a Library Function

Python Program to Calculate the Number of Words & Characters Present in a String

Python Program to Count Number of Lowercase Characters in a String

Python Program to Count the Number of Vowels in a String

Python Program to Calculate the Number of Upper Case & Lower Case Letters in a String

Python Program to Calculate the Number of Digits and Letters in a String

Python Program to Print All Permutations of a String in Lexicographic Order using Recursion

Python Program to Print All Permutations of a String in Lexicographic Order without Recursion

Python Program to Check if the Substring is present in the given String

Python Program to Check Common Letters in Two Input Strings


Python Program that Displays which Letters are Present in Both the Strings

Python Program that Displays which Letters are in the First String but not in the Second

Python Program that Displays which Letters are in the Two Strings but not in Both

Python Program to Form a New String Made of the First 2 and Last 2 characters of a String

Python Program to Take 2 Strings & Display the Larger String without using Built-in Functions

Python Program to Form a New String where the First & Last Character have been Exchanged

Python Program to Accept a Hyphen Separated Sequence of Words as Input & Print it

Python Program to Count the Occurrences of Each Word in a Given String Sentence

Python Program to Count the Number of Vowels Present in a String using Sets

Python Program to Check if a given String is Palindrome

Python Program to Check whether two Strings are Anagrams

Python Program to Check whether a given String is Palindrome or not using Recursion

Python Program to Find All Numbers which are Odd and Palindromes Between a Range of Numbers
without using Recursion
Python Programs on Dictionary

Python Program to Form a Dictionary from an Object of a Class

Python Program to Check if a Given Key Exists in a Dictionary or Not

Python Program to Add a Key-Value Pair to the Dictionary

Python Program to Sum All the Items in a Dictionary

Python Program to Multiply All the Items in a Dictionary

Python Program to Remove the Given Key from a Dictionary

Python Program to Concatenate Two Dictionaries Into One

Python Program to Map Two Lists into a Dictionary

Python Program to Create a Dictionary with Key as First Character and Value as Words Starting with that
Character

Python Program to Generate a Dictionary that Contains Numbers in the Form (x,x*x)

Python Program to Count the Frequency of Words Appearing in a String Using a Dictionary

Python Programs on Tuples

Python Program to Create a List of Tuples with the First Element as the Number and Second Element as
the Square of the Number

Python Program to Remove All Tuples in a List of Tuples with the USN Outside the Given Range

Python Program to Sort a List of Tuples in Increasing Order by the Last Element in Each Tuple
Python Programs on Classes & Objects

Python Program to Create a Class which Performs Basic Calculator Operations

Python Program to Append, Delete and Display Elements of a List Using Classes

Python Program to Find the Area of a Rectangle Using Classes

Python Program to Create a Class and Compute the Area and the Perimeter of the Circle

Python Program to Create a Class in which One Method Accepts a String from the User and Another
Prints it

Python Program to Create a Class and Get All Possible Subsets from a Set of Distinct Integers

Python Programs on File Handling

Python Program to Read the Contents of the File

Python Program to Copy File into Another File

Python Program to Find the Number of Lines in a Text File

Python Program to Count the Number of Blank Spaces in a Text File

Python Program to Count the Occurrences of a Word in a Text File

Python Program to Count the Number of Words in a Text File

Python Program to Capitalize First Letter of every Word in a File

Python Program to Count the Number of Times a Certain Letter Appears in the Text File

Python Program to Read a Text File and Print all the Numbers Present in the Text File

Python Program to Read the Contents of a File in Reverse Order

Python Program to Append the Content of File at the end of Another


Python Program to Read a String from the User and Append it into a File

Python Programs on List

Python Program to Find the Largest Number in a List

Python Program to Find the Second Largest Number in a List

Python Program to Print Largest Even and Largest Odd Number in a List

Python Program to Put Even and Odd Elements in a List into Two Different Lists

Python Program to Calculate the Average of Numbers in a Given List

Python Program to Print Sum of Negative Numbers, Positive Even & Odd Numbers in a List

Python Program to Search the Number of Times a Particular Number Occurs in a List

Python Program to Find the Sum of Elements in a List Recursively

Python Program to Find the Length of a List Using Recursion

Python Program to Merge Two Lists and Sort it

Python Program to Remove the Duplicate Items from a List

Python Program to Swap the First and Last Value of a List

Python Program to Sort the List According to the Second Element in Sublist

Python Program to Read a List of Words and Return the Length of the Longest One

Python Program to Find Element Occurring Odd Number of Times in a List

Python Program to Generate Random Numbers from 1 to 20 and Append Them to the List

Python Program to Remove the ith Occurrence of the Given Word in a List

Python Program to Find the Cumulative Sum of a List

Python Program to Find the Union of two Lists

Python Program to Find the Intersection of Two Lists


Python Program to Flatten a List without using Recursion

Python Program to Find the Total Sum of a Nested List Using Recursion

Python Program to Flatten a Nested List using Recursion

Python Programs on Linked List

Python Program to Create a Linked List & Display the Elements in the List

Python Program to Remove Duplicates from a Linked List

Python Program to Check whether 2 Lists are Same

Python Program to Solve Josephus Problem using Linked List

Python Program to Print Nth Node from the last of a Linked List

Python Program to Interchange two Elements of the List without touching the Key Field

More Python Programs on Linked List

Python Programs on Singly Linked List

Python Program to Illustrate the Operations of Singly Linked List

Python Program to Demonstrate Circular Single Linked List

Python Program to Check whether a Singly Linked List is a Palindrome

Python Program to Convert a given Singly Linked List to a Circular List

advertisement

Python Programs on Doubly Linked List

Python Program to Implement Circular Doubly Linked List


Python Program to Find the Largest Element in a Doubly Linked List

Python Program to Implement a Doubly Linked List & Perform Insertion & Deletion Operations

Python Programs on Stack

Python Program to Implement Stack

Python Program to Implement Stack using One Queue

Python Program to Implement Stack Using Two Queues

Python Program to Reverse a Stack using Recursion

Python Program to Check String is Palindrome using Stack

Python Program to Check if Expression is correctly Parenthesized

Python Programs on Queue

Python Program to Implement Queue

Python Program to Implement Dequeue

Python Program to Implement Queues using Stacks

Python Programs on Tree

Python Program to Implement Binomial Tree

Python Program to Construct a Tree & Perform Insertion, Deletion, Display

Python Program to Find the Number of Nodes in a Binary Tree

Python Program to Display the Nodes of a Tree using BFS Traversal

Python Program to Find Nth Node in the Inorder Traversal of a Tree


Python Program for Depth First Binary Tree Search using Recursion

Python Programs on Heap

Python Program to Implement Binary Heap

Python Program to Implement Binomial Heap

Python Program to Implement Fibonacci Heap

Python Program to Implement D-ary-Heap

Python Program to Implement Ternary Heap

Python Programs on Graph

Python Program to Implement Graph

Python Program to Check the Connectivity of Undirected Graph Using BFS

Python Program to Find MST (Minimum Spanning Tree) using Kruskal’s Algorithm

Python Program to Find MST (Minimum Spanning Tree) using Prim’s Algorithm

Python Program to Implement Dijkstra’s Shortest Path Algorithm

Python Program to Implement Bellmanford Algorithm

Python Program to Implement Floyd-Warshall Algorithm

Python Program to Implement Johnson’s Algorithm

Python Program to Find if Undirected Graph is Bipartite using BFS

Python Program to Find if Undirected Graph is Bipartite using DFS


Python Programs on Searching

Python Program to Implement Linear Search

Python Program to Perform Binary Search using Recursion

Python Program to Select the ith Smallest Element from a List in Expected Linear Time

Python Program to Select the ith Largest Element from a List in Expected Linear Time

Python Program to solve Maximum Subarray Problem using Divide and Conquer

Python Program to solve Maximum Subarray Problem using Kadane’s Algorithm

Python Programs on Sorting

Python Program to Implement Insertion Sort

Python Program to Implement Selection Sort

Python Program to Implement Bubble Sort

Python Program to Implement Merge Sort

Python Program to Implement Quick sort

Python Program to Implement Comb Sort

Python Program to Implement Radix Sort

Python Program to Sort a List According to the Length of the Elements


Python Programs on Gaming

Python Program to Demonstrate Tower Of Hanoi

Python Program to Solve the Celebrity Problem

Python Program to Solve n-Queen Problem with Recursion

Python Program to Solve n-Queen Problem without Recursion

Python Programs on Greedy Algorithms

Python Program to Solve Fractional Knapsack Problem using Greedy Algorithm

Python Program to Solve Interval Scheduling Problem using Greedy Algorithm

Python Program to Find the Smallest Set of Unit-Length Closed Intervals that Contains All Points using
Greedy Algorithm

Python Program to Minimize Lateness using Greedy Algorithm


Python Programs on Dynamic Programming

Python Program to Print nth Fibonacci Number using Dynamic Programming with Memoization

Python Program to Print nth Fibonacci Number using DP with Bottom-Up Approach

Python Program to Solve Rod Cutting Problem using Dynamic Programming with Memoization

Python Program to Solve Rod Cutting Problem using DP with Bottom-Up Approach

Python Program to Solve 0-1 Knapsack Problem using DP with Memoization

Python Program to Solve 0-1 Knapsack Problem using DP with Bottom-Up Approach

Python Program to Solve Matrix-Chain Multiplication using DP with Memoization

Python Program to Solve Matrix-Chain Multiplication using DP with Bottom-Up Approach

Python Program to Find Longest Common Subsequence using Dynamic Programming with Memoization

Python Program to Find Longest Common Subsequence using Dynamic Programming with Bottom-Up
Approach

Python Program to Find Longest Common Substring using Dynamic Programming with Memoization

Python Program to Find Longest Common Substring using Dynamic Programming with Bottom-Up
Approach

Python Program to Count all Paths in a Grid with Holes using Dynamic Programming with Memoization

Python Program to Count all Paths in a Grid with Holes using Dynamic Programming with Bottom-Up
Approach

You might also like