Drool 5: There is a way, and then there is a Trick !!
Tricks are amazing! Right?
Especially when it comes to Programming. With Python, there are a few tricks that you can have up your sleeves.
Look at the code below.
row = [1, 2, 3, 4]
print(','.join(str(x) for x in row))
>>> 1,2,3,4
Expected !!
Can we do it cleaner and with fewer lines? Sure we can !!
print(*row, sep=',')
Try it out and let me know !! In the meantime, follow @pydrools on Twitter.