0

I have a function that iterates through a text file and compares the text from the file with 2 other texts. I want my function to return when either text condition is met, whichever is first.

if I have a function:

myfunc(paramA, paramB or paramC):

will it pass paramC at the same iteration if paramB condition fails?

For explanation sake as my function is quite abstract, lets say I'm comparing lines of text from a file with inputted string in my function. I would want the function to return the line of text that is == to my inputted string or the reverse ([::-1]) of the text I inputted, whichever is first.

If there is a line that matches my inputted string forward at line 5 in the file, but matches the reverse of my string at line 2, I'd want the string from line 2 returned.

0 Answers0