Python Programming Examples 2023

Python Programming Examples 2023

Basic Python Programs:

  1. Python Program to check Armstrong Number
  2. Python program to print all Prime numbers in an Interval
  3. Python program to check whether a number is Prime or not
  4. Python Program for n-th Fibonacci number
  5. Python Program for Program to find the area of a circle
  6. Python Program for cube sum of first n natural numbers
  7. Python program to add two numbers
  8. Python Program for factorial of a number
  9. Maximum of two numbers in Python
  10. Python Program for Sum of squares of first n natural numbers
  11. Python Program for compound interest
  12. Python Program for simple interest
  13. Python Program for How to check if a given number is a Fibonacci number?
  14. Python Program for n\’th multiple of a number in Fibonacci Series
  15. Program to print ASCII Value of a character

Array Programs In Python:

  1. Python Program to find the largest element in an array
  2. Python Program for array rotation
  3. Python Program to check if a given array is Monotonic
  4. Python Program to find the sum of the array
  5. Python Program to Split the array and add the first part to the end
  6. Python Program for Reversal algorithm for array rotation
  7. Python Program for Finding reminders of array multiplication divided by n

Python List Programs :

  1. Python program to swap two elements in a list
  2. Python program to interchange first and last elements in a list
  3. Python | Ways to check if an element exists in the list
  4. Different ways to clear a list in Python
  5. Python | Ways to find the length of the list
  6. Python | Reversing a List
  7. Python program to find the smallest number in a list
  8. Python program to find the second largest number in a list
  9. Python program to find the largest number in a list
  10. Python program to find the sum of elements in the list
  11. Python | Multiply all numbers in the list
  12. Python program to find N largest elements from a list
  13. Python program to print even numbers in a list
  14. Python program to print all even numbers in a range
  15. Python program to print all odd numbers in a range
  16. Python program to print odd numbers in a List
  17. Python – Remove empty List from List
  18. Python | Count occurrences of an element in a list
  19. Python | Remove empty tuples from a list
  20. Python | Cloning or Copying a list
  21. Remove multiple elements from a list in Python
  22. Python program to print positive numbers in a list
  23. Python program to print negative numbers in a list
  24. Python program to print all positive numbers in a range
  25. Break a list into chunks of size N in Python
  26. Python program to print all negative numbers in a range
  27. Python | Program to print duplicates from a list of integers
  28. Python program to find the Cumulative sum of a list
  29. Python | Sum of number digits in List
  30. Python | Sort the values of the first list using the second list

Matrix Programs In Python:

  1. Python program to multiply two matrices
  2. Python program for Matrix Product
  3. Python program to add two Matrices
  4. Adding and Subtracting Matrices in Python
  5. Python | Matrix creation of n*n
  6. Transpose a matrix in a Single line in Python
  7. Python | Get Kth Column of Matrix
  8. Python – Vertical Concatenation in Matrix

String Programs In Python:

  1. Python program to check whether the string is Symmetrical or Palindrome
  2. Python program to print even length words in a string
  3. Python – Convert Snake case to Pascal case
  4. Ways to remove i’th character from string in Python
  5. Python program to check if a string is a palindrome or not
  6. Reverse words in a given String in Python
  7. Python program to accept the strings which contain all vowels
  8. Python  Program to check if a string contains any special character
  9. Python program to split and join a string
  10. Python program to check if a given string is a binary string or not
  11. Python program to  Check if a Substring is Present in a Given String
  12. Python program to check Words Frequency in String Shorthands
  13. Remove all duplicates from a given string in Python
  14. Find the length of a string in python (4 ways)
  15. Python program to Count the Number of matching characters in a pair of string
  16. Least Frequent Character in String
  17. Maximum frequency character in String
  18. Generating random strings until a given string is generated
  19. Find words that are greater than the given length k
  20. Python program for removing i-th character from a string
  21. Python program to find uncommon words from two Strings
  22. String slicing in Python to rotate a string
  23. Replace duplicate Occurrence in String
  24. Replace multiple words with K
  25. Permutation of a given string using an inbuilt function
  26. Check for URL in a String
  27. Python program to Replace all occurrences of a substring in a string
  28. Execute a String of Code in Python
  29. String slicing in Python to check if a string can become empty by recursive deletion
  30. Python Counter To Find all duplicate characters in a string

Dictionary Programs In Python:

  1. Python – Extract Unique values dictionary values
  2. Python program to find the sum of all items in a dictionary
  3. Python program to check the Ways to remove a key from a dictionary
  4. Ways to sort the list of dictionaries by values in Python – Using itemgetter
  5. Ways to sort the list of dictionaries by values in Python – Using lambda function
  6. Python | Merging two Dictionaries
  7. Insertion at the beginning in OrderedDict
  8. Check the order of characters in string using OrderedDict( )
  9. Dictionary and counter in Python to find the winner of the election
  10. Append Dictionary Keys and Values ( In order ) in the dictionary
  11. Sort Python Dictionaries by Key or Value
  12. Sort Dictionary key and values List
  13. Handling missing keys in Python dictionaries
  14. Python dictionary with keys having multiple inputs
  15. Print anagrams together in Python using List and Dictionary
  16. K’th Non-repeating Character in Python using List Comprehension and OrderedDict
  17. Check if binary representations of two numbers are anagram
  18. Python Counter to find the size of the largest subset of anagram words
  19. Remove all duplicate words from a given sentence
  20. Python Dictionary to find mirror characters in a string
  21. Possible Words using given characters in Python
  22. Scraping And Finding Ordered Words In A Dictionary using Python
  23. Counting the frequencies in a list using a dictionary in Python
  24. Convert a list of Tuples into Dictionary
  25. Python counter and dictionary intersection example (Make a string using deletion and rearrangement)
  26. Python dictionary, set and counter to check if frequencies can become the same
  27. Keys associated with Values in Dictionary
  28. Python program to Convert key-values list to flat dictionary

Python Tuple Programs:

  1. Python program to Find the size of a Tuple
  2. Python – Maximum and Minimum K elements in Tuple
  3. Create a list of tuples from a given list having a number and its cube in each tuple
  4. Python – Adding Tuple to List and vice–versa
  5. Python – Closest Pair to Kth index element in Tuple
  6. Python – Join Tuples if the similar initial element
  7. Python – Extract digits from the Tuple list
  8. Python – All pair combinations of 2 tuples
  9. Python – Remove Tuples of Length K
  10. Sort a list of tuples by the second Item
  11. Python program to Order Tuples using external List
  12. Python – Flatten tuple of List to tuple
  13. Python – Convert Nested Tuple to Custom Key Dictionary

Searching and Sorting Programs In Python:

  1. Python Program for Linear Search
  2. Python Program for Insertion Sort
  3. Python Program for Recursive Insertion Sort
  4. Python Program for Binary Search (Recursive and Iterative)
  5. Python Program for Selection Sort
  6. Python Program for Iterative Merge Sort
  7. Python Program for Counting Sort
  8. Python Program for Radix Sort
  9. Python Program for Stooge Sort
  10. Python Program for QuickSort
  11. Python Program for Iterative Quick Sort
  12. Python Program for Bubble Sort
  13. Python Program for Merge Sort
  14. Python Program for Cycle Sort
  15. Python Program for Pigeonhole Sort
  16. Python Program for Bitonic Sort
  17. Python Program for Heap Sort
  18. Python Program for ShellSort
  19. Python Program for Topological Sorting
  20. Python Program for Binary Insertion Sort
  21. Python Program for Comb Sort
  22. Python Program for Cocktail Sort
  23. Python Program for Gnome Sort
  24. Python Program for Odd-Even Sort / Brick Sort
  25. Python Program for BogoSort or Permutation Sort

Pattern Printing Programs In Python:

  1. Python Program to print an Inverted Star Pattern
  2. Python Program to print double-sided stair-case pattern
  3. Python Program to print the pattern ‘G’
  4. Python Program to print with your own font

Date-Time Programs In Python:

  1. Get Current Date and Time using Python
  2. Python | Find yesterday’s, today’s, and tomorrow’s date
  3. Convert date string to the timestamp in Python
  4. Python program to get Current Time
  5. How to convert timestamp string to DateTime object in Python?
  6. Python program to convert time from 12 hours to 24-hour format
  7. Find the number of times every day occurs in a Year
  8. Python program to find the difference between the current time and a given time
  9. Python Program to Create a Lap Timer

Python Regex Programs In Python:

  1. Python Program to put spaces between words starting with capital letters using Regex
  2. Python program to extract IP address from the file
  3. Python – Check whether a string starts and ends with the same character or not
  4. Python Regex to extract maximum numeric value from a string
  5. Python regex to find sequences of one upper case letter followed by lower case letters
  6. Python Program to Remove duplicate words from Sentences
  7. Python | Remove all characters except letters and numbers
  8. Python Program to find the most occurring number in a string using Regex
  9. Python Program to Check if String Contains Only Defined Characters using Regex
  10. Python program to Count Uppercase, Lowercase, special character, and numeric values using Regex
  11. Python Regex | Program to accept string ending with an alphanumeric character
  12. Python Program to check if a string starts with a substring using regex
  13. Python Regex – Program to accept string starting with a vowel
  14. Python Program to Check if an URL is valid or not using Regular Expression
  15. Parsing and Processing URL using Python – Regex
  16. Python Program to validate an IP address using ReGex
  17. Python Program to Check if email address valid or not
  18. Python program to find files having a particular extension using RegEx
  19. Categorize Password as Strong or Weak using Regex in Python
  20. Python program to check the validity of a Password

Python File Handling Programs In Python:

  1. Python program to Count the Number of occurrences of a key-value pair in a text file
  2. Python Program to remove lines starting with any prefix
  3. Python Program to merge two files into a third file
  4. Python program to read character by character from a file
  5. Python | Finding ‘n’ Character Words in a Text File
  6. Python – Get the number of characters, words, spaces, and lines in a file
  7. Python program to read file word by word
  8. Python program to Reverse a single line of a text file
  9. Python Program to obtain the line number in which the given word is present
  10. Count the number of lines in a text file in Python
  11. Python program to reverse the content of a file and store it in another file
  12. Python Program to Reverse the Content of a File using Stack
  13. Python – Append the content of one text file to another
  14. Python program to copy odd lines of one file to other
  15. Python Program to Eliminate repeated lines from a file
  16. Python Program to read List of Dictionaries from File

Leave a Reply

Your email address will not be published. Required fields are marked *