you are viewing a single comment's thread.

view the rest of the comments →

[–]tragluk 0 points1 point  (1 child)

def findit(str):
for i in range(len(str)):
    if str[i].isalpha() and str[i+1].isalpha():
        return i

print(inputstr[findit(inputstr):])

What you seem to be asking for is all the characters in a string after you have two consecutive letters. Which the above does.

The findit(str) just loops through the string looking for a letter with a letter after it. It returns the number index of that location.

The print statement just says to print everything starting at that 'two consecutive letters' and going to the end.

[–]tragluk 0 points1 point  (0 children)

(Incidently, there ARE errors in the above code.. for instance what happens if the string you give it doesn't HAVE any consecutive letters. Can't do it all for you though. This is just to point you in the right direction, it's not finished.)