Issue
This code prints as output [8.1]
. I would like to print 8
cursor.execute ('SELECT date FROM Archive WHERE product =?', (element,))
values3 = [row [0] for row in cursor]
#values3 is [8.1]
I have used, but i get error AttributeError: 'list' object has no attribute 'split'
a = values3.split('.')
b = a[0]
print(b)
Can you help me please? Thank you
Solution
Try this: a = values3[0] a = str(a).split(".")[0]
Answered By - Advik
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.