This functions searches for records in my database. Apart from if condition the else statement ( "Record not found") also keeps on executing even if the condition is true. OUTPUT screenshot
def displaySearchAcc():
try:
    command = "SELECT * FROM BANK"
    mycursor.execute(command)
    s = mycursor.fetchall()
    ch = input("Enter the account number to be searched : ")
    for i in s:
        i = list(i)
        if i[0] == ch:
            print("*" * 125)
            print("ACCNO", "NAME", "MOBILE", "EMAIL", "ADDRESS", "CITY", "COUNTRY", "BALANCE")
            print("=" * 125)
            for j in i:
                print("%14s" % j, end=' ')
                print()
        else:
            print("record not found")
except:
    print("Table not found")
 
     
    