Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribed

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

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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago

Question

Ability to work comfortably in a team environment

Answered: 1 week ago

Question

Exposure to SQL desirable but not required

Answered: 1 week ago