wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

LECTURE 07 (01.12.2025)

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

True or False: A virtual environment helps keep your project’s packages separate from other projects.

a)

True

b)

False

2.

Which command do you use to add files to the Git staging area?

a)

git commit

b)

git add

c)

git push

d)

git pull

3.

True or False: The Git staging area is where your changes wait before you save them to the project history.

a)

True

b)

False

4.

Which Python module lets you read environment variables?

a)

sys

b)

os

c)

math

d)

json

5.

True or False: The command git pull sends your changes to the remote repository.

a)

True

b)

False

6.

Which command makes a new virtual environment in Python?

a)

python -m venv myenv

b)

pip install myenv

c)

git init myenv

d)

python create myenv

7.

Why do we use a virtual environment?

a)

To make code run faster

b)

To keep project packages separate

c)

To use more RAM

d)

To connect to the internet

8.

Which Git command saves the changes from the staging area to your project history?

a)

git add

b)

git commit

c)

git push

d)

git clone

9.

What is the correct way to read an environment variable called DB_PASSWORD in Python?

a)

password = os.getenv('DB_PASSWORD')

b)

password = getenv('DB_PASSWORD')

c)

password = os.environ('DB_PASSWORD')

d)

password = os.get('DB_PASSWORD')

10.

True or False: Environment variables are used to store settings like passwords outside your code.

a)

True

b)

False

11.

You want to get your files ready for the next Git commit. Which command do you use?

a)

git push

b)

git commit

c)

git add

d)

git checkout

12.

If you have two Python projects and want to keep their packages separate, what should you do?

a)

Use one global environment

b)

Make a virtual environment for each project

c)

Install all packages system-wide

d)

Only use built-in modules

13.

After you use git add, what is the next command to save your changes?

a)

git push

b)

git commit

c)

git clone

d)

git status

14.

Which command installs all the packages listed in requirements.txt into your virtual environment?

a)

pip install requirements.txt

b)

pip install -r requirements.txt

c)

python install requirements.txt

d)

git install requirements.txt

15.

Why should you use environment variables for things like passwords?

a)

To make your code faster

b)

To keep passwords out of your code

c)

To use less memory

d)

To make your code longer

16.

You changed three files but only want to save one in your next Git commit. What should you do?

a)

Use git add only on the file you want

b)

Use git commit -a

c)

Use git push

d)

Use git clone

17.

You have two Python projects that need different versions of the same package. What should you do?

a)

Install both versions globally

b)

Use a virtual environment for each project

c)

Only use the latest version

d)

Avoid using the package

18.

Write a Python program that prints the value of the environment variable called "MY_SECRET". What is the output if you set MY_SECRET to "hello123" before running the code?

a)

hello123

b)

MY_SECRET

c)

None

d)

Error

19.

You want to make sure your app works on another computer. What should you do with your dependencies?

a)

Copy your site-packages folder

b)

Use requirements.txt and pip install -r requirements.txt in a virtual environment

c)

Only install Python

d)

Use git clone only

20.

Write a Python program that reads the environment variable "DB_PASSWORD" and prints "Password found" if it exists, or "No password" if it does not. What will the program print if DB_PASSWORD is not set?

a)

Password found

b)

No password

c)

Error

d)

DB_PASSWORD