Python Program to Find Common Characters in Two Strings

This is a Python Program to check common letters in the two input strings. Problem Description The program takes two strings and checks common letters in both the strings. Problem Solution 1. Enter two input strings and store it in separate variables. 2. Convert both of the strings into sets and find the common letters … Read more

advertisement

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

This is a Python Program to count the occurrences of each word in a given string sentence. Problem Description The program takes a string and counts the occurrence of each word in the given sentence. Problem Solution 1. Take a string and a word from the user and store it in separate variables. 2. Initialize … Read more

advertisement

Python Program to Check if the Substring is Present in the Given String

This is a Python Program to check if a substring is present in a given string. Problem Description The program takes a string and checks if a substring is present in the given string. Problem Solution 1. Take a string and a substring from the user and store it in separate variables. 2. Check if … Read more

advertisement

Python Program to Calculate the Length of a String Without using Library Functions

This is a Python Program to calculate the length of a string without using library functions. Problem Description The program takes a string and calculates the length of the string without using library functions. Problem Solution 1. Take a string from the user and store it in a variable. 2. Initialize a count variable to … Read more

advertisement

Python Program to Create a New String Made up of First and Last 2 Characters

This is a Python Program to form a new string made of the first 2 characters and last 2 characters from a given string. Problem Description The program takes a string and forms a new string made of the first 2 characters and last 2 characters from a given string. Problem Solution 1. Take a … Read more

advertisement

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

This is a Python Program to accept a hyphen separated sequence of words as input and print the words in a hyphen-separated sequence after sorting them alphabetically. Problem Description The program accepts a hyphen separated sequence of words as input and print the words in a hyphen-separated sequence after sorting them alphabetically. Problem Solution 1. … Read more

advertisement

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

This is a Python Program to calculate the number of digits and letters in a string. Problem Description The program takes a string and calculates the number of digits and letters in a string. Problem Solution 1. Take a string from the user and store it in a variable. 2. Initialize the two count variables … Read more

advertisement

Python Program to Count Number of Uppercase and Lowercase Letters in a String

This is a Python Program to count the number of lowercase letters and uppercase letters in a string. Problem Description The program takes a string and counts the number of lowercase letters and uppercase letters in the string. Problem Solution 1. Take a string from the user and store it in a variable. 2. Initialize … Read more

advertisement

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

This is a Python Program to check if a string is a pangram or not. Problem Description The program takes a string and checks if it is a pangram or not. Problem Solution 1. Take a string from the user and store it in a variable. 2. Pass the string as an argument to a … Read more

advertisement

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

This is a Python Program to determine how many times a given letter occurs in a string recursively. Problem Description The program takes a string and determines how many times a given letter occurs in a string recursively. Problem Solution 1. Take a string and a character from the user and store it in different … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.