def getIndexes(string1,string2):
    """checks if string2 is present in string1 and returns 
    all the positions at which string2 occurs in string1"""
    ret = []
    ind = string1.find(string2)
    
    while (ind > -1 and ind < len(string1)):
        ret.append(ind)
        ind = string1.find(string2,ind + 1)
        
    return ret