id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

konstans@stuy.edu all > findWord
prev  |  next  |  chance

Determine if a string word is inside of a string original. DO NOT use the built-in string method find! Both target and word are strings of any length. Return the index of the leftmost occurrence of the word, or -1 when it isn't found.


findWord('salad', 'x') → -1
findWord('fish', 'fi') → 0
findWord('fish', 'sh') → 2

...Save, Compile, Run (ctrl-enter)

def findWord(original,word):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy