Skills101
← All practice quizzes

Quiz: Modules and Libraries

5 questionsNo time limitPass: 60%+10 XP on first pass

Split code into modules, import them correctly, use the standard library (math, random, datetime, collections), install packages with pip and use virtual environments.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What does from math import sqrt let you write?

  2. Question 2

    What does this print?

    from collections import Counter
    print(Counter("aabbbc")["b"])
    
  3. Question 3

    What is the purpose of if __name__ == "__main__":?

  4. Question 4

    Which command creates a virtual environment named .venv?

  5. Question 5

    Why should you NOT name your file random.py?