Worksheet - String
1. Accept a sentence ‘S’ and a word ‘W’ from the user. Write a program that
determines how frequently W appears in S. The program should treat all
occurrences of the word equally, regardless of their case.
e.g. in the sentence 'The quick brown fox jumps over the lazy dog because the dog
was too lazy,' the word 'the' appears 3 times.
2. Create a Python script that generates an acronym from a given string. For
example, "North Atlantic Treaty Organization" should return "NATO".
3. Write a program that counts the number of vowels in a given string. The output
should distinguish between lowercase and uppercase vowels.
4. Write a Python program that scans a string and prints out all characters that
appear consecutively more than once. For example, given the string
"mississippi", the output should be "ssp" because the characters 's' and 'p'
appear consecutively more than once. Ensure the program preserves the order
and frequency of characters as they appear in the input string.