Understanding now.year (month, day ...) [SOLVED]


I'm trying to understand when the prompt says "In the third line, we take the year (and only the year) from the variable now and store it in current_year."
Why isn't the correct code for this instruction: now = current_year From my understanding, variable = _____ .

from datetime import datetime
now = datetime.now()

current_year = now.year
current_month = now.month
current_day = now.day
print now.year
print now.month
print now.day


The instruction says to

store it in current_year.

this means that current_year is your variable that you are storing your now.year into.
current_year = now.year is correct.


Thank you. I did not understand the instruction.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.