Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Version of Python being used is 2.7. You be given two strings containing only English letters. Write an algorithm to count the number of occurrences
- Version of Python being used is 2.7. You be given two strings containing only English letters. Write an algorithm to count the number of occurrences of the second string in the first string. (You may disregard the case of the letters.) Input The first line of the input consists of a string parent, representing the first string. The second line consists of a string sub, representing the second string. Output Print an integer representing the number of occurrences of Sub in Parent. If no occurrence of Sub is found in Parent then print 0. Example Input: TimisplayinginthehouseofTimwiththel Tim Output: 3 Explanation: Tim occurs 3 times in the first string. So, the output is 3. 21°C Mostly cloudy
Step 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