ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 256 - PT0-002 discussion

Report
Export

A penetration tester created the following script to use in an engagement:

However, the tester is receiving the following error when trying to run the script:

Which of the following is the reason for the error?

A.
The sys variable was not defined.
Answers
A.
The sys variable was not defined.
B.
The argv variable was not defined.
Answers
B.
The argv variable was not defined.
C.
The sys module was not imported.
Answers
C.
The sys module was not imported.
D.
The argv module was not imported.
Answers
D.
The argv module was not imported.
Suggested answer: C

Explanation:

The sys module is a built-in module in Python that provides access to system-specific parameters and functions, such as command-line arguments, standard input/output, and exit status. The sys module must be imported before it can be used in a script, otherwise an error will occur. The script uses the sys.argv variable, which is a list that contains the command-line arguments passed to the script.

However, the script does not import the sys module at the beginning, which causes the error "NameError: name 'sys' is not defined". To fix this error, the script should include the statement "import sys" at the top. The other options are not valid reasons for the error.

asked 02/10/2024
George Weine Paulino Chaves
48 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first