Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. (30pts) Write a Python program to display a string's index 0,1,2,6,7,8,12,13,14,18,19,20, ( 3 on and 3 off pattern) location characters for any string given.
1. (30pts) Write a Python program to display a string's index 0,1,2,6,7,8,12,13,14,18,19,20, ( 3 on and 3 off pattern) location characters for any string given. Sample Input String: "abcdefghijklmnopqrstuvwxyz" Sample Output : abcohimnostuyz 2. (30pts) Write a Python program to find out all index locations that has a certain pattern a string. (return a list, return [] if no such pattern in the string.) Sample String : "abaaababbbbaaabbabababababbbaaaaabababababbbbb" Pattern: "abb" Sample Output : [6,13,24,40]
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