manipulating_dates_in_python
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
manipulating_dates_in_python [2023/09/18 17:56] – [date in isoformat] raju | manipulating_dates_in_python [2023/12/02 17:07] – [iterate over a range of dates] raju | ||
---|---|---|---|
Line 160: | Line 160: | ||
* http:// | * http:// | ||
+ | ==== print the names of months in a year ==== | ||
+ | < | ||
+ | $ ipython | ||
+ | Python 3.11.4 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 13:47:18) [MSC v.1916 64 bit (AMD64)] | ||
+ | IPython 8.12.0 -- An enhanced Interactive Python. Type '?' | ||
+ | In [1]: | ||
+ | import calendar | ||
+ | for m in calendar.month_name: | ||
+ | print(m) | ||
+ | |||
+ | |||
+ | January | ||
+ | February | ||
+ | March | ||
+ | April | ||
+ | May | ||
+ | June | ||
+ | July | ||
+ | August | ||
+ | September | ||
+ | October | ||
+ | November | ||
+ | December | ||
+ | </ |
manipulating_dates_in_python.txt · Last modified: 2024/02/06 05:22 by raju