print("Input number in format 0YYYxxxx:") x = input() import sqlite3 conn = sqlite3.connect ("D:\DB_SQLITE\elta_db.db") cursor = conn.cursor() cursor.execute ("""select Raion, bloc, realphone, phone, elta_number.coord, elta_coord.coord, elta_coord.board, elta_coord.port_on_board from elta_number INNER JOIN elta_coord ON elta_number.coord = elta_coord.coord where realphone=?""", (x,)) for row in cursor: if (x,)== row(2): print ("Number= ", row[3]) print ("District= ", row[0]) print ("Bloc= ", row[1]) print ("Coord= " , row[4]) print ("Board= ",row[6]) print ("Port= ",row[7]) else: print ("This number don't exist") conn.close
Ошибка:
Traceback (most recent call last):
File “Dprograming/Elta_numar__for_forum.py”, line 10, in <module>
if (x,)== row(2):
TypeError: ‘tuple’ object is not callable