[Solved] Why the else part is executed everytime the result is matched
The first problem: def display(self): if SearchString in per.fname: print per.fname, per.lname elif SearchString in per.lname: print per.fname, per.lname else: print “No String” if statements do not form a group of alternatives themselves. To indicate that use the elif keyword, so the else part will be executed if none of the conditions were met. In … Read more