STEP 4: We can see that the unformatted datetime includes a lot of information, but we want to see the date alone.

In Python, special symbols are used to format dates and times from datetime objects. Each symbol is preceded by %. To format the months, you would use %m within the strftime() command. For days, use %d.

  • Go to . Drag Date Format - 12/31/19 indented at the bottom of the main() function.
  • Click Run then click on the Console button to see the formatted date!

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)