List Comprehension In Reverse Order With Python

How do you perform a list comprehension in reverse using Python? A list comprehension is generally a short one line code that allows you to create a new list by iterating through an iterator (such as another list). The syntax for a list comprehension is [expression for variable in iterable if condition] with the if …

Read more

How To Remove Leading Zeroes With Python Dates

How do you remove leading zeroes in Python formatted dates? I have been sending data through to a Suitescript API endpoint and have received the error that the date information I am sending through needs to be of the format D/M/YYYY, here’s the error specifically: Currently, the way the date is formatted and sent from …

Read more

JSON.dumps Not Able To Serialize Object

If you have tried to serialize an object in Python into JSON you may have come across an oblique error that mentions you’re unable to serialize it, but what does this mean? I recently had an example whereby I needed to transfer a dict object through to an external API endpoint and I thought by …

Read more