Question 1 Strings Frequency

Find Repeated Characters in a Sentence

Write a program to input string sentence and print only print words which contains repeated characters.like goods,egg,happy,etc

Solution Code Screenshot Click image to zoom
Repeated Characters in Sentence Solution
Question 2 Strings Validation

Check if String Contains Only Consonants

Write a Python program to verify whether a given string consists entirely of consonants (alphabetic characters with no vowels).

Solution Code Screenshot Click image to zoom
Contain Only Consonants Solution
Question 3 Strings Pangram

Check for Consecutive Repeated Characters in a String

Write a Python program to read a string from standard input and determine whether it contains any consecutive identical characters (e.g., "oo" in "good"). Use a loop to compare adjacent indices and display an appropriate message indicating whether consecutive duplicate characters exist.

Solution Code Screenshot Click image to zoom
Para Contains Every Alphabet Solution
Question 4 Strings Duplicate Check

Check Whether a String is a Pangram

Write a Python program to accept a string from standard input and determine whether it is a pangram. A pangram is a sentence or phrase that contains every letter of the English alphabet from a to z at least once, irrespective of letter case, digits, punctuation, or spaces.

Solution Code Screenshot Click image to zoom
Repeated Character Contains Or Not Solution
Question 5 Strings Comparison

Compare Two Strings Using Relational Operators

Python program to compare them lexicographically using relational operators (==, !=, <, >, <=, >=).

Solution Code Screenshot Click image to zoom
String Comparison Solution
Question 6 Strings Concatenation

Reverse a String Using Concatenation and Check for Palindrome

Write a Python program to take a string from the user, reverse it using loop-based string concatenation (rev = a + rev) without using slicing ([::-1]), and check whether the original string is a Palindrome.

Solution Code Screenshot Click image to zoom
Concatenation and Reverse Solution
Question 7 Strings Case & Frequency

Convert to Uppercase and Count Character Frequency

Write a Python program to convert a string into uppercase and calculate the frequency of each unique letter.

Solution Code Screenshot Click image to zoom
Convert Uppercase and Count Frequency Solution
Question 8 Strings Character Analysis

Count Alphabets, Digits, Uppercase, Lowercase, and Spaces

Write a Python program to read a string and count the total number of uppercase letters, lowercase letters, numerical digits, and whitespace characters.

Solution Code Screenshot Click image to zoom
Count Alphabets Digits Spaces Solution
Question 9 Strings Vowels

Count Total Vowels in a String

Write a Python program that takes a string input and determines the total count of vowels (a, e, i, o, u, both uppercase and lowercase).

Solution Code Screenshot Click image to zoom
Count Only Vowels Solution
Question 10 Strings Vowel Breakdown

Count Each Vowel Individually

Write a Python program to count occurrences of each individual vowel ('a', 'e', 'i', 'o', 'u') separately in a given user string.

Solution Code Screenshot Click image to zoom
Count Vowels Solution
Question 11 Strings Indexing

Separate Characters at Even and Odd Index Positions

Write a Python program to split a string into two separate parts: one containing characters at even index positions and the other at odd index positions.

Solution Code Screenshot Click image to zoom
Even Odd Separate Solution
Question 12 Strings Intersection

Find Common Characters in Two Strings

Write a Python program to input two different strings and print all characters that appear in both strings without duplicate entries.

Solution Code Screenshot Click image to zoom
Common Character in Two Strings Solution
Question 13 Strings Word Count

Find the Frequency of Each Word in a Sentence

Write a Python program to accept a sentence and count how many times each distinct word appears in the text.

Solution Code Screenshot Click image to zoom
Frequency of Word in Sentence Solution
Question 14 Strings Basics

First String Program: Input and Display

Write a Python program to demonstrate direct element retrieval from a string using positive indexing (from the start) and negative indexing (from the end).

Solution Code Screenshot Click image to zoom
First String Program Solution
Question 15 Strings Search

Find the First Vowel in a String and its Position

Write a Python program to search through a string, identify the very first vowel encountered, and display its character and index position.

Solution Code Screenshot Click image to zoom
Found First Vowel in String Solution
Question 16 Strings Built-in Methods

Count Character Types Using String Testing Methods

Write a Python program using isupper(), islower(), isdigit(), and isspace() methods to classify and count all characters in an input string.

Solution Code Screenshot Click image to zoom
String Methods Count Solution
Question 17 Strings String Methods

Demonstration of Built-in Python String Functions

Write a Python program to demonstrate common string methods including upper(), lower(), title(), strip(), replace(), find(), etc.

Solution Code Screenshot Click image to zoom
String Functions Solution
Solution Code Screenshot Click image to zoom
String Functions Solution
Solution Code Screenshot Click image to zoom
String Functions Solution
Solution Code Screenshot Click image to zoom
String Functions Solution
Solution Code Screenshot Click image to zoom
String Functions Solution
Solution Code Screenshot Click image to zoom
String Functions Solution
Question 18 Strings Sentence Processing

Find the Longest Word in a Sentence

Write a Python program that accepts a sentence and determines the longest word.

Solution Code Screenshot Click image to zoom
Longest Word in Sentence Solution
Question 19 Strings Palindrome

Print All Palindrome Words in a Sentence

Write a Python program to parse a sentence and print only those words that read the same backwards as forward (palindromes like 'madam', 'racecar').

Solution Code Screenshot Click image to zoom
Palindrome Words Solution
Question 20 Strings Iteration

Extract and Print All Vowels from a String

Write a Python program to read an input string and display all vowels present in the string in order of their appearance.

Solution Code Screenshot Click image to zoom
Print Vowels Solution
Question 21 Strings Formatting

Print Each Word of a Sentence on a New Line

Write a Python program to split a given sentence by whitespace and print each constituent word on its own individual line.

Solution Code Screenshot Click image to zoom
Print Word in New Line Solution
Question 22 Strings Sanitization

Remove All Digits from a String

Write a Python program to take an alphanumeric string and remove all numeric digits, returning only letters and special symbols.

Solution Code Screenshot Click image to zoom
Remove Digits Solution
Question 23 Strings Replication

String Replication Operator (*) Star Pattern

Write a Python program utilizing string repetition (* operator) to generate and display pyramid or triangle patterns of asterisks without inner nested loops.

Solution Code Screenshot Click image to zoom
Replication Star Print Solution
Solution Code Screenshot Click image to zoom
Replication Star Print Solution
Question 24 Strings Slicing

Reverse a String Using Slicing [::-1]

Write a Python program to reverse any user-provided string using slice step syntax [::-1] and print the result.

Solution Code Screenshot Click image to zoom
Reverse Print Solution
Question 25 Strings Paragraph Split

Split Paragraph into Sentences on New Lines

Write a Python program to take a multisentence paragraph, split sentences based on period delimiters, and print each sentence on a new line.

Solution Code Screenshot Click image to zoom
Sentence New Line Solution
Question 26 Strings Slicing

Comprehensive Demonstration of String Slicing

Write a Python program demonstrating start, stop, and step slice parameters (positive indexing, negative indexing, and stride steps) on a sample string.

Solution Code Screenshot Click image to zoom
String Slices Solution
Question 27 Strings Masking & Slicing

Format and Extract Parts of a Phone Number via Slicing

Write a Python program to take a 10-digit phone number as a string, extract the country code, area code, and mask central digits using string slicing.

Solution Code Screenshot Click image to zoom
Phone Number Slicing Solution
Question 28 Strings Boundary Check

Check if String Starts and Ends with a Vowel

Write a Python program to check whether a given string simultaneously starts with a vowel and ends with a vowel.

Solution Code Screenshot Click image to zoom
Start End with Vowels Solution
Question 29 Strings Traversal

Traverse a String Character by Character

Write a Python program to traverse a string using a for loop and while loop, printing each character alongside its forward and backward index.

Solution Code Screenshot Click image to zoom
String Traversing Solution
Question 30 Strings Word Counting

Count Total Words in a Sentence

Write a Python program to input a sentence and calculate the total number of words present without being affected by consecutive multiple spaces.

Solution Code Screenshot Click image to zoom
Word Count in Sentence Solution
Question copied to clipboard!