Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python program to find occurrence of each character in the given string by using dictionary concept. Note:- The input should be string only,
Write a Python program to find occurrence of each character in the given string by using dictionary concept.
Note:-
The input should be string only, in order to represent the same use pair of single quotes only (eg:- good). Otherwise if your input is other than string then simply print Invalid input.
The result should be in the prescribed format only (Case sensitive).
Print the result in ascending order (according to the ASCII code).
Grade deduction is 15% for each test cases. Totally four test cases are given.
Write a Python program to find occurrence of each character in the given string by using dictionary concept. Note:- The input should be string only, in order to represent the same use pair of single quotes only (eg:- 'good'). Otherwise if your input is other than string then simply print "Invalid input". The result should be in the prescribed format only (Case sensitive). Print the result in ascending order (according to the ASCII code). Grade deduction is 15% for each test cases. Totally four test cases are given. Sample input and output:- Input:- 'Good_is_good' Output:- The result is: G:1 :2 d:2 9:1 i:1 0:4 S: 1 Input:- 426 Output:- Invalid input Input:- 4.5 Output:- Invalid input Input:- 'Good' Output:- The result is: G:1 d: 1 0:2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started