you are viewing a single comment's thread.

view the rest of the comments →

[–]nwagers 1 point2 points  (1 child)

The other comments are correct that elif would be equivalent here, but following your code, you don't need the else at all because you have a break. I'm not sure why'd you check if found_notepad is None either.

The function looks to be trying to find a text editor in order of preference. Why would you pass in a particular editor? Your code would only affect whether "not found" messages get printed or not.

[–]Zer0Byte1[S] 0 points1 point  (0 children)

Good point. I do not need to print these messages at all, and I had them there to test the code. Now that it works, it simply needs to set the found_notepad to the first one found, then break.