ECE181 - Practice Sheet - FujnctionsStrings
ECE181 - Practice Sheet - FujnctionsStrings
1. Problem: Write a program to count the number of uppercase and lowercase letters in
a string using string methods.
2. Problem: Create a program that checks if a string starts with a particular substring.
3. Problem: Write a program to find and replace all occurrences of a word in a given
string.
4. Problem: Implement a program that checks if a string ends with a certain suffix.
5. Problem: Write a program to convert a string to title case (where the first letter of
each word is capitalized).
6. Problem: Create a program to remove all leading and trailing spaces from a string.
7. Problem: Write a program to find the index of the first occurrence of a substring in a
string.
8. Problem: Implement a program to split a string into a list of words.
9. Problem: Write a program to count the number of occurrences of a character in a
string.
10. Problem: Create a program to join a list of words into a single string with a space as
the separator.
11. Problem: Write a program that converts a given string into all uppercase letters.
12. Problem: Implement a program to check if a string is numeric using string methods.
13. Problem: Write a program to reverse the words in a sentence using string methods.
14. Problem: Create a program that replaces all vowels in a string with asterisks (*).
15. Problem: Write a program to check if two strings are equal, ignoring case sensitivity.