Guys, I have to make a program that and then asks user to input some word let's say (until user types STOP) and then checks if the word is in the list by linear search. And I can't use "in" operator here. This is so weird to me, can you give me some tips?
_________________________________
_________________________________
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import sys infile = open ( "ex5.acc" , "r" ) acc = '' line = infile.readline() while acc ! = "STOP" : acc = input ( "Enter acc nr" ) line = infile.readline() if acc ! = line and acc ! = "STOP" : print ( "It seems that there is no such accession nr in the file" ) elif acc = = line: print ( "Accession number found" ) print ( "Seems like you don;t want to search anymore" ) |