STEP 9: To see the current time of day, we need the hour from the datetime object.

Datetime objects are a special Python data type. They have attributes which we access easily by using datetime.hour, datetime.date, or datetime.time.

  • In SUBJECT, go to and drag out Hour so that it's indented at the bottom of the main() function.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)