Skip to content

How to get the current year in Python?

import datetime
now = datetime.datetime.now().year
print(now)
See also  How do i print a list line by line in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.