GATE DA Python OOP, Modules & Exception Handling | Set 1

Questions 71-75 of 100

0% completed (0/100 answered)
Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 71

MCQ · Single Correct 1 mark

What is the value of __name__ when a Python script is executed directly from the command line?

Answers for question 71

Question 72

NAT · Numerical Answer 1 mark

In an interactive Python session, what is the first entry in sys.path used for imports?

Answers for question 72

Question 73

MCQ · Single Correct 1 mark

Which file must be present in a directory to mark it as a Python package in traditional Python (prior to namespace packages)?

Answers for question 73

Question 74

MCQ · Single Correct 1 mark

What happens when you re-import an already imported module in the same Python session using import mod_name?

Answers for question 74

Question 75

NAT · Numerical Answer 1 mark

Consider a file mod.py containing:
__all__ = ['a', 'b']
$a = 1
b = 2
c = 3

If another script runs$from mod import *, how many variables from mod are imported into the local namespace?

Answers for question 75
Scroll to Top