import sqlite3
with sqlite3.connect('base.db') as db:
sql = db.cursor()
sql.execute("""CREATE TABLE IF NOT EXISTS users (
login TEXT,
password TEXT,
cash BIGINT
)""")
user_login = input("LOGIN: ")
user_password = input("PASSWORD: ")
sql.execute("SELECT login FROM users")
if sql.fetchone() is None:
sql.execute(f"INSERT INTO users VALUES ('?, ?, ?')", (user_login, user_password, 0))
print("Зарегистрировано")
else:
print("Такая запись уже имеется!")
for value in sql.execute("SELECT * FROM users"):
print(value)