Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions