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

New Text Document

PYTHON QUESTIONS

Uploaded by

soodhardik12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

New Text Document

PYTHON QUESTIONS

Uploaded by

soodhardik12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

for coding questions

Sure! Here are some coding questions, ranging from basic to advanced, to help you
practice your Python skills:

Basic Python Coding Questions


Write a Python program to print "Hello, World!".

Write a Python program to add two numbers.

Write a Python program to find the square root of a number.

Write a Python program to calculate the area of a triangle.

Write a Python program to swap two variables.

Write a Python program to generate a random number.

Write a Python program to check if a number is positive, negative or zero.

Write a Python program to check if a number is odd or even.

Write a Python program to find the largest among three numbers.

Write a Python program to find all prime numbers in an interval.

Intermediate Python Coding Questions


Write a Python program to find the factorial of a number.

Write a Python program to display the multiplication table of a given number.

Write a Python program to print the Fibonacci sequence.

Write a Python program to check if a number is an Armstrong number.

Write a Python program to find the sum of natural numbers.

Write a Python program to find the sum of digits of a number.

Write a Python program to reverse a string.

Write a Python program to check if a string is a palindrome.

Write a Python program to sort a list in ascending order.

Write a Python program to find the second largest number in a list.

Advanced Python Coding Questions


Write a Python program to implement a binary search algorithm.

Write a Python program to implement a bubble sort algorithm.

Write a Python program to count the occurrences of each word in a given text file.

Write a Python program to merge two sorted lists.

Write a Python program to find the intersection of two lists.

Write a Python program to flatten a nested list.


Write a Python program to generate all permutations of a given string.

Write a Python program to find the longest common subsequence in two strings.

Write a Python program to solve the Tower of Hanoi problem.

Write a Python program to implement a stack using a list.

Expert Python Coding Questions


Write a Python program to implement a queue using a list.

Write a Python program to solve a Sudoku puzzle.

Write a Python program to implement a binary tree.

Write a Python program to traverse a binary tree using in-order traversal.

Write a Python program to find the height of a binary tree.

Write a Python program to implement a linked list.

Write a Python program to reverse a linked list.

Write a Python program to detect a cycle in a linked list.

Write a Python program to find the middle element of a linked list.

Write a Python program to implement a hash table.

Write a Python program to check if a binary tree is balanced.

Write a Python program to find the lowest common ancestor in a binary tree.

Write a Python program to sort a list using the quicksort algorithm.

Write a Python program to implement a graph using an adjacency list.

Write a Python program to perform a depth-first search on a graph.

Write a Python program to perform a breadth-first search on a graph.

Write a Python program to find the shortest path in a graph using Dijkstra's
algorithm.

Write a Python program to detect a cycle in a graph.

Write a Python program to find the minimum spanning tree of a graph using Kruskal's
algorithm.

Write a Python program to implement a priority queue using a heap.

Write a Python program to solve the N-Queens problem.

Write a Python program to implement a trie.

Write a Python program to find the maximum subarray sum using Kadane's algorithm.

Write a Python program to find the longest increasing subsequence in a list.


Write a Python program to perform matrix multiplication.

Write a Python program to find the transpose of a matrix.

Write a Python program to implement a least recently used (LRU) cache.

Write a Python program to implement a counting sort algorithm.

Write a Python program to implement the knapsack problem using dynamic programming.

Write a Python program to find the longest palindromic substring in a string.

Write a Python program to implement a balanced binary search tree.

Write a Python program to perform operations on a balanced binary search tree.

Write a Python program to implement a red-black tree.

Write a Python program to implement an AVL tree.

Write a Python program to implement a segment tree.

Write a Python program to implement a Fenwick tree (binary indexed tree).

Write a Python program to find the maximum flow in a network using the Ford-
Fulkerson algorithm.

Write a Python program to solve the traveling salesman problem using dynamic
programming.

Write a Python program to find the convex hull of a set of points using the Graham
scan algorithm.

Write a Python program to implement the KMP string matching algorithm.

Write a Python program to implement the Boyer-Moore string matching algorithm.

Write a Python program to find the median of two sorted arrays.

Write a Python program to perform matrix exponentiation.

Write a Python program to solve the maximum bipartite matching problem.

Write a Python program to implement the Hungarian algorithm.

Write a Python program to implement a skip list.

Write a Python program to implement a B-tree.

Write a Python program to implement a suffix tree.

Write a Python program to perform operations on a suffix tree.

Write a Python program to solve the edit distance problem using dynamic
programming.

Write a Python program to implement the Viterbi algorithm for hidden Markov models.

Write a Python program to find the k-th smallest element in a list using a heap.
Write a Python program to implement the Hopcroft-Karp algorithm for maximum
bipartite matching.

Write a Python program to implement the Floyd-Warshall algorithm for finding


shortest paths in a weighted graph.

Write a Python program to find the maximum subarray product.

Write a Python program to implement the Rabin-Karp string matching algorithm.

Write a Python program to implement a bloom filter.

Write a Python program to implement the Bellman-Ford algorithm for finding shortest
paths in a weighted graph.

Write a Python program to implement the Johnson's algorithm for finding shortest
paths in a sparse graph.

Write a Python program to implement a disjoint set data structure (union-find).

Write a Python program to implement the Edmonds-Karp algorithm for finding maximum
flow in a network.

Write a Python program to implement the push-relabel algorithm for finding maximum
flow in a network.

Write a Python program to implement the Tarjan's algorithm for finding strongly
connected components in a graph.

Write a Python program to implement the Prim's algorithm for finding the minimum
spanning tree of a graph.

Write a Python program to implement the Kruskal's algorithm for finding the minimum
spanning tree of a graph.

Write a Python program to implement the Ford-Fulkerson algorithm for finding the
maximum flow in a network.

Write a Python program to implement the Edmonds-Karp algorithm for finding the
maximum flow in a network.

Write a Python program to implement the push-relabel algorithm for finding the
maximum flow in a network.

Write a Python program to implement the A* search algorithm.

Write a Python program to implement the Dijkstra's algorithm for finding the
shortest path in a weighted graph.

You might also like