i am getting stuck on this line:
row[1].upper().find('CELEBREX',1) (this is returning -1)
it seems to not find CELEBREX even though it is there
row[1] = 'celebrex, TRAMADOL'
am i casting to UPPER incorrectly?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The second argument of find() shouldn’t be
1, because it will start search after the first character of the string.Find() will return 0 because it found the first match at position
0, the first position in the string. So it’s important to note that, as you’ve already discovered, the if find() doesn’t find the string, it will return -1. Return value 0 is actually a match.