Categories
Uncategorized

Formatting Integers – Python

We have a range from 1 to 100 and we want to format the integers so that they look nice. Something like this so first we create the range which should result in something like this The actual formatting code is quite simple, this But to apply it to a list, we can do this […]

Categories
Uncategorized

Formatting Dates – Python

We have a date like this 3rd April 2013 and we want to change it to this 2013-04-03 We can change the date format using the datetime module. In this module we can use strptime( ) to tell Python that the string is a date, and then strftime( ) to change the date to the […]