MCQ Practice Single Best Answer Topic: Create Objects in Python

Q Which of the following is not a way to import the module 'm1' or the functions 'f1' and 'f2' defined in it?

Question ID
#20268
Subchapter
Create Objects in Python
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A from m1 import f1, f2
  • B from m1 import *
  • C import m1
  • D import f1, f2 from m1
Correct Answer: D

Explanation

The statement that is not a valid way to import the module 'm1' or the functions 'f1' and 'f2' defined in it is:


import f1, f2 from m1

The correct syntax for importing specific functions from a module is:


from m1 import f1, f2

So, the correct answer is: import f1, f2 from m1

Share This Question

Share this MCQ with your friends or study group.