All pastes #729990 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-08 19:12 UTC
rendered paste body
def whereis(s1,s2):
    '''whereis(str, str)-> int/boolean
    
    Returns the index number of the first occurence of the single letter 
    string s2 in the string s1. Returns False if the parameters given are not 
    strings or s2 is not a single letter in length. Returns -1 if s2 is not
    found in s1.'''
 
    if ( type(s1) != str ) or ( type(s2) != str ):
        return False
    
    if ( len(s2) != 1 ):
        return False
    
    return s1.find(s2)