-Input: n = 9
List: 2 3 2 3 5 2 3 2 5
After processing: result = 5
Output for marking:
OUTPUT:
5
Question 4 (3 marks)
The given file Q4.py already contains statements to input data for the string (a sentence contains words separated by spaces) and a string variable named str. You should write statements to count words (notcase sensitive) that end with string str.
Notes:
- You can create new functions if you see it is necessary.
- Do not edit given statements in the main function.
Sample input and output:
Input:
Enter a sentence: "hello worLD world"
Enter a string: rLd
After processing: count = 2
Output for marking:
OUTPUT:
2
UOVERFLOW.C