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

 

david.white@denison.edu cs112fall2015 > findWord
prev  |  next  |  chance

Write a function findWords(text,target) which searches the string text and finds the first place where target appears as a whole word (not contained in another word). Notice that you could have punctuation right after target (which you may assume is a period, exclamation mark, question mark, semi-colon, dash, comma, or quotation mark)


findWord('Code for finding all examples is hard to find! Right?', 'find') → 41
findWord('Sandy punctuation and-or dashes are silly and fun', 'and') → 18
findWord('How about an easy one?', 'How') → 0

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

def findWord(text, target):

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