Drool 5: There is a way, and then there is a Trick !!
pydrools.substack.com
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 !!
Drool 5: There is a way, and then there is a Trick !!
Drool 5: There is a way, and then there is a…
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 !!