The picture shows that everything else works properly instead there is an empty space in the code and that makes the program print "was invalid." I have no idea where the empty space comes from, any suggestions?
selec1 = open("strings.txt","r")
selec2 = "bob"
while selec2:
selec2 = selec1.readline().replace("\n","")
if selec2.isalnum() == True:
print(selec2,"was ok.")
if selec2.isalnum() == False:
print(selec2,"was invalid.")