CBSE Class 12 Computer Science Question 9 of 62

Using Python Libraries — Question 4

Back to all questions
4
Question

Question 4

Which is the correct command to load just the tempc method from a module called usable ?

  1. import usable, tempc
  2. import tempc from usable
  3. from usable import tempc
  4. import tempc
Answer

from usable import tempc

Reason — The syntax for importing single method form a module is : from <module> import <objectname>. According to the syntax, the correct method is from usable import tempc.