subject

Write a python function that takes a string of words separated by spaces (assume no punctuation or capitalization) and a "target" phrase, and shows all the positions of the target phrase in the string of words. for example, if the string is: we dont need no education we dont need no thought control no we dont and the target phrase is "dont", then your function should return the list [1, 6, 13] because "dont" appears at the 1st, 6th, and 13th position in the string. another example of target phrase is "we dont" which should give [0, 5, 12] as the result. we start counting positions of words in the string from 0. your function should return false if the target phrase doesn't appear in the string.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
image
Computers and Technology, 24.06.2019 10:40, 29delphina
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
Answers: 1
image
Computers and Technology, 24.06.2019 14:00, maddi0132
In the microsoft® access® and microsoft excel® programs, the ribbon contains tabs that are divided into with like tools in them. parts groups containers bunches
Answers: 1
image
Computers and Technology, 24.06.2019 17:50, jones03riley
You work in the accounting department and have been using a network drive to post excel workbook files to your file server as you complete them. when you attempt to save a workbook file to the drive, you see the error message: “you do not have access to the folder ‘j: \’. see your administrator for access to this folder.” what should you do first
Answers: 2
You know the right answer?
Write a python function that takes a string of words separated by spaces (assume no punctuation or c...

Questions in other subjects:

Konu
English, 14.04.2021 01:00
Konu
Mathematics, 14.04.2021 01:00
Konu
History, 14.04.2021 01:00
Konu
Mathematics, 14.04.2021 01:00
Konu
Mathematics, 14.04.2021 01:00
Konu
Mathematics, 14.04.2021 01:00