Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What file do you need to create in your package directory to indicate it is a package?
It's a special file with double underscores.
Name a common reason for creating your own Python package.
Think about multiple projects.
What is the purpose of the __init__.py file?
It's what makes your folder special!
True or False: A Python package can contain multiple modules.
Think about how packages are structured!
Design a Python package named 'Weather' that includes modules for temperature conversion and weather data retrieval. Write how you would structure this package.
Think about what modules you would want in a weather package!
Create a function named divide in 'math_operations.py' to divide two numbers. Explain how to call this function from a script after defining your package.
Remember to check for division by zero in your function!
4 more questions in this section. Enroll free to practise them all.
Enroll free