The command line arguments in Python can be printed as a list of string by…

2025

The command line arguments in Python can be printed as a list of string by executing

  1. A.

    OS.argv

  2. B.

    Sys.argv

  3. C.

    .argv

  4. D.

    None of these

Attempted by 41 students.

Show answer & explanation

Correct answer: B

In Python, command line arguments are accessed using the sys module. The list of arguments is stored in the argv attribute, written as sys.argv.

Explore the full course: Mppsc Assistant Professor