Multiple choice

What correctly imports the datetime library?

  1. import datetime from datetime

  2. import from datetime

  3. from datetime import datetime

  4. import datetime

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The syntax 'from module import object' is the standard way to import a specific class or function from a library. Option D is also a valid way to import the whole module, but C is the most specific way to import the datetime class.