crsr.execute("SELECT * FROM tblmob")
res = crsr.fetchall()
for i in res:
nopol = i [2]
print(nopol)
and the ouput is row formating like this without the bullet
- B 9020 BCS
- B 9243 BQB
- B 9244 BQB
- B 9307 KXR
- B 9552 UXT
- B 9730 BCK
- B 9733 CXS
- B 9746 WRU
- B 9782 FXR
how can i get only one data from mylist
i want get only B 9552 UXT
please help me thanks
i have tried many time but is always fails
2
Answers
I don’t know how your res list look like, but if it is a simple list like this one:
you can get the single data by its index, like:
this will return a string in index number 4 which is:
please share what res look like.
Add a conditional to your loop, so it only prints the desired element
Result: