May-31-2020, 01:51 AM
i have a string (str,bytes,bytearray) and an object with one or more characters (str,bytes,bytearray,set,frozenset,list,tuple). the beginning of the string has some number of characters that would get a True result if the
in
operator is used with that object while stepping through the string until it reaches a character that would get False. as this is hard to explain, here is some code:def runlen(s,o): for n in range(len(s)): if s[n] in o: continue return nwhat i would like to know is if there is a way to call something to do that loop internally so it would run faster. maybe re can do this, somehow. once i have the position n, i will be using s[:n] though not s[n:]. so, something that just gives me the prefix would do the job.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.