Bird
0
0

Which of the following is the correct syntax to import a module named random?

easy📝 Syntax Q3 of 15
Python - Modules and Code Organization
Which of the following is the correct syntax to import a module named random?
Ainclude random
Busing random
Cimport random
Drequire random
Step-by-Step Solution
Solution:
  1. Step 1: Recall Python import syntax

    Python uses the keyword import to bring in modules.
  2. Step 2: Identify the correct syntax

    The correct way is import random. Other options are from different languages or incorrect.
  3. Final Answer:

    import random -> Option C
  4. Quick Check:

    Correct import syntax = import random [OK]
Quick Trick: Use 'import' keyword to bring in modules [OK]
Common Mistakes:
  • Using 'include' instead of 'import'
  • Using 'require' or 'using' which are not Python keywords
  • Missing the import keyword

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes