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

 

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

Determine if a string called letter is in another string original, assume the letter is a String of length 1. DO NOT use the built-in string method find! You must return the index of the leftmost occurrence of the letter in the original string, or a -1 if it isn't found.


findLetter('fish', 'f') → 0
findLetter('fish', 'F') → -1
findLetter('fish', 'h') → 3

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

def findLetter(original,letter):

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