values is a list looks like ['13020638659', '711799502', '4681912759', '07/21/2021']
I’d like to connect all of its elements to create a value_str look like this
(13020638659, 711799502, 4681912759, '07/21/2021')
This is what I do values_str = "(%s)" % (', '.join( values ))
But the output would be (13020638659, 711799502, 4681912759, 07/21/2021)
There are no quotes for the datatime string. How can I add quotes on it?
>Solution :
You need to use different code to format the date than the numbers, so you can add quotes around it.
values_str = f"({', '.join(values[:-1])}, '{values[-1]}')"