The database stores 2 data lines
- login = admin, password = admin
- login = Twiss, password = 2332c623
when executing this code
import sqlite3 a = input('логин') b = input('пароль') conn = sqlite3.connect('client.db') try: sql = "SELECT Login, Password, Surname FROM authentication" cur = conn.cursor() cur.execute(sql) data = cur.fetchall() for row in data: if a in str(row[0]): if b in str(row[1]): print('Авторизован') else: print("Не верный пароль") else: print("Не верный логин") finally: conn.close() If you enter login = Twiss, password = 2332c623, the value is not the correct login and is authorized, and if you enter login = admin, password = admin then everything is fine. How to make it so that when entering other data besides admin, it is displayed only authorized and worked so that according to the logic of authorization
__getitem__calls.__getitem__/ finally instead of with you with the construction. Example - jfs