nerdexam
GIAC

GPYC · Question #5

A programmer attempts to run the Python program hello.py as follows, but an error occurs. What is the cause of this error? student@573:~ cat hello.py print "hello" student@573:~ chmod -x hello.py…

The correct answer is A. hello.py is missing the line #!/usr/bin/python. You've hit your limit · resets 1pm (America/New_York)

Python Fundamentals & Command Line Tools

Question

A programmer attempts to run the Python program hello.py as follows, but an error occurs. What is the cause of this error? student@573:~ cat hello.py print "hello" student@573:~ chmod -x hello.py student@573:~ ./hello.py Warning: unknown mime-type for "hello" -- using "application/x-tcl" Error: no such file "hello"

Options

  • Ahello.py is missing the line #!/usr/bin/python
  • Bsmtp_mime was replaced with Python
  • CPython cannot find the script "hello"
  • Dhello.py is improperly encoded with UTF-16le

How the community answered

(30 responses)
  • A
    93% (28)
  • C
    3% (1)
  • D
    3% (1)

Explanation

You've hit your limit · resets 1pm (America/New_York)

Topics

#shebang line#script execution#file permissions#command line

Community Discussion

No community discussion yet for this question.

Full GPYC Practice