MCQ Single Best Answer Difficult

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

ID: #20268 Create Objects in Python 94 views
Question Info
#20268Q ID
DifficultDifficulty
Create Objects in PythonTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A from m1 import f1, f2
  • B from m1 import *
  • C import m1
  • D import f1, f2 from m1
Correct Answer: Option 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

Challenge a friend or share with your study group.