nerdexam
Cisco

350-401 · Question #545

Refer to the exhibit. Which result does the python code achieve?

The correct answer is C. The code converts time to the yyyymmdd representation.. The Python code utilizes the datetime module to get the current date and time, then formats it into a string using strftime("%Y%m%d").

Submitted by yasin.bd· Mar 6, 2026Automation

Question

Refer to the exhibit. Which result does the python code achieve?

Exhibits

350-401 question #545 exhibit 1
350-401 question #545 exhibit 2

Options

  • AThe code encrypts a base64 decrypted password.
  • BThe code converts time to the "year/month/day" time format.
  • CThe code converts time to the yyyymmdd representation.
  • DThe code converts time to the Epoch LINUX time format.

How the community answered

(33 responses)
  • A
    3% (1)
  • C
    94% (31)
  • D
    3% (1)

Why each option

The Python code utilizes the `datetime` module to get the current date and time, then formats it into a string using `strftime("%Y%m%d")`.

AThe code encrypts a base64 decrypted password.

The code uses Python's `datetime` module for time manipulation, not functions related to encryption, decryption, or password handling.

BThe code converts time to the "year/month/day" time format.

To convert time to the "year/month/day" format, the `strftime` format string would need explicit separators, such as `"%Y/%m/%d"`.

CThe code converts time to the yyyymmdd representation.Correct

The `datetime.datetime.now().strftime("%Y%m%d")` method formats the current date into a string where `%Y` represents the four-digit year, `%m` the two-digit month, and `%d` the two-digit day, resulting in a concatenated `yyyymmdd` representation (e.g., 20231026).

DThe code converts time to the Epoch LINUX time format.

Epoch (UNIX) time represents the number of seconds since January 1, 1970, which is typically obtained using a method like `timestamp()` and is a numerical value, not a string format like `yyyymmdd`.

Concept tested: Python datetime formatting (strftime)

Source: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

Topics

#Python scripting#Datetime module#Time formatting#yyyy-mm-dd format

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice