Practice Pin dependency versions with requirements.txt - 5.2 | Chapter 12: Working with External Libraries and APIs | Python Advance
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Academics
Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Professional Courses
Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skillsβ€”perfect for learners of all ages.

games

Practice Questions

Test your understanding with targeted questions related to the topic.

Question 1

Easy

What command do you use to create a requirements.txt file?

πŸ’‘ Hint: Think about how we capture installed packages.

Question 2

Easy

Why is it important to pin versions in requirements.txt?

πŸ’‘ Hint: Consider what happens if different people use different versions.

Practice 4 more questions and get performance evaluation

Interactive Quizzes

Engage in quick quizzes to reinforce what you've learned and check your comprehension.

Question 1

What command captures all installed packages and their versions?

  • pip list
  • pip freeze
  • pip install

πŸ’‘ Hint: This command is used to generate requirements files.

Question 2

True or False: It is best practice to update your requirements.txt file after adding a new library.

  • True
  • False

πŸ’‘ Hint: Think about how you maintain a list.

Solve 1 more question and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

You are working on a project that has suddenly failed after updating a library. Describe how you would use requirements.txt to troubleshoot the issue.

πŸ’‘ Hint: What is the first thing to look for in the file?

Question 2

Your colleague installs your project on their machine and reports errors related to missing libraries. Explain how the requirements.txt file can resolve this.

πŸ’‘ Hint: What command do we use for batch installation?

Challenge and get performance evaluation