Question: 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
Get step-by-step solutions from verified subject matter experts
