GPYC Exam QuestionsBrowse all questions from this exam

GPYC Exam - 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?

Show Answer
Correct Answer: A

The cause of the error is that the script hello.py is missing the line #!usr/bin/python. This line is called a shebang and it specifies the path to the interpreter that should be used to execute the script. Without it, the operating system does not know which interpreter to use and thus cannot execute the file directly.

Discussion

1 comment
Sign in to comment
VenudharOption: A
Nov 18, 2023

The option is A