Nov-25-2018, 03:24 AM
Please use python and output tags when posting code and results. I put them in for you this time. Here are instructions for doing it yourself next time.
cursor.fetchone is returning a tuple of length 1. By using today = (no comma), you just get the tuple. But using today, = (with a comma) is using tuple assignment. As in:
cursor.fetchone is returning a tuple of length 1. By using today = (no comma), you just get the tuple. But using today, = (with a comma) is using tuple assignment. As in:
>>> nums = (1, 2) >>> one, two = nums >>> one 1 >>> two 2And they are not the same type. You are just checking the type of the second today twice. If you had check the type of the first today before reassigning it, you would see it was equal to datetime. Here's an example:
>>> one = (1,) >>> one (1,) >>> uno, = (1,) >>> uno 1 >>> type(one) <class 'tuple'> >>> type(uno) <class 'int'>
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures