Handling Strings
Strings are a fundamental data type in Python. They allow us to work with textual data and provide a wide range of operations and methods to manipulate and analyze text. This page includes beginner-friendly exercises on string handling, combining logic building using loops and conditions, as well as string functions.
1. Count Vowels
Pyground
Input a string and count the number of vowels in it.
Output:
2. Reverse String
Pyground
Input a string and reverse it using a loop.
Output:
3. Check Palindrome
Pyground
Input a string and check if it is a palindrome.
Output:
4. Check Anagrams
Pyground
Input two strings and check if they are anagrams.
Output:
5. Remove Spaces
Pyground
Input a string and remove all spaces from it.
Output:
6. Character Frequency
Pyground
Input a string and find the frequency of each character.
Output:
7. Count Words
Pyground
Input a sentence and count the number of words.
Output:
8. Convert to Uppercase
Pyground
Input a string and convert it to uppercase without using str.upper().
Output:
9. ASCII Values
Pyground
Input a string and print each character along with its ASCII value.
Output:
10. Replace Vowels
Pyground
Input a string and replace all vowels with *.
Output:
Last updated on