Jan-09-2022, 03:55 PM
Hello, I'm trying to loop over a dictionary that contains date but as I do so I'm unable to print out the date, can you help me on this and possibly explain why? Thanks
Below is my code snippet:
C:\Users\...\Desktop\coding>python dict_date.py
Jane
Daniel
George
Below is my code snippet:
from datetime import date my_dates = {"Jane": str(date(1994, 12, 25)), "Daniel": str(date(2000, 11, 13)), "George": str(date(1971, 9, 27))} for mdate in my_dates: print(mdate)Output:
C:\Users\...\Desktop\coding>python dict_date.py
Jane
Daniel
George