Home>
I'm trying to fetch data with fetchall(). Full code:
cursor.execute(f'SELECT exchange_offer_id FROM exchange WHERE exchange_name= "finder"')
exchange= cursor.fetchall()
offers= exchange #all data here
print(offers)
The result looks like this:
[(4,), (3,)]
The data type of the column itself is NUMERIC.
The question is, why does the output show a comma in the value itself? And how can it be removed?
How to remove -well, for example offers= [x[0] for x in exchange]
andreymal2022-01-25 22:42:13@andreymal, thank you very much!
SaNoKProG2022-01-25 22:42:13Related questions
- python : sqlite3 db returns none
- python : Can I get a True\False response instead of a value in Sqlite?
- Can't uninstall/install Python
- python : Why does list.remove() incorrectly remove elements in a loop?
- Loading bar in Python 3.x
- Program for finding synonyms of Russian words python
- javascript : How to pass value of js variables to python(eel)?
- python : How to create a window in the game for example (dota2)
- python : How to speed up polynomial hash calculation
Because this is a tuple of one element, and in the syntax it is always supposed to have a comma in a tuple
andreymal2022-01-25 22:42:13