Question: 3. Write a Python script to get a string from user and prints out the number of occurrences of the first character in the string.
3. Write a Python script to get a string from user and prints out the number of occurrences of the first character in the string. It then prints out a new string where all occurrences of the first char have been changed to ", except the first char itself. (25 points) For example: Please enter a string: cute cat in the car 'c' has been repeated 3 times. cute *at in the "ar 4. Write a Python scripts to get a sequence of different positive numbers from user in one line separated by single space) and prints out a list including all the number's digits in descending order. It then prints out what the max digit is and how many times it has been repeated in the original input. (35 points) For example: please enter a sequence of positive digits separated by single space 111 202 872 678 939 190 319 5 25 67 14 The list of sorted digits in descending order is ['9', '9', '9', '9', '8', '8', '7', '7', '7', '6', '6', '5', '5', '4', '3', '3', '2', '2', '2', '2', '1','1','1', '1','1','1', '0', 'O'] Max is 9. It has been repeated 4 times
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
