Summary: Python Essentials 2
- This + 400k other summaries
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding
Read the summary and the most important questions on Python Essentials 2
-
1 Module 1
-
1.1 Modules
This is a preview. There are 5 more flashcards available for chapter 1.1
Show more cards here -
You want to invoke the function make_money() contained in the module named mint. Your code begins with the following line:import mintWhat is the proper form of the function's invocation?
Call the function using `mint.make_money ()`. -
You've written a function named make_money on your own. You need to import a function of the same name from the mint module and don't want to rename any of your previously defined names. Which variant of the import statement may help you with the issue?
from mint import make_money as make_more_money -
What form of the make_money function invocation is valid if your code starts with the following line?from mint import *
Thevalid form ismake_money (). -
Which function can you use to list all functions in a module?
You can use the "dir ()"function to list allfunctions in amodule provided the function has been imported in full. -
What function describes the underlying platform, and what parameter allows you to shorten the printed output?
You can use the "platform.platform ()"function . You canshorten the output with the "terse=True"parameter . -
What code should you run if you just want to know the generic name of the processor which runs your OS?
You can run thefunction platform .processor () -
What code should you run if you just want to know the generic name of the OS?
You canrun thefunction platform .system() -
What code should you run if you just want to know the version of the OS?
TheOS version is provided as a string by theplatform .version ()function . -
What code should you run if you just want to know the version of python?
platform.python_version _tuple() -
What is the expected value of the result variable after the following code is executed?import math result = math.e == math.exp(1)
The expectedvalue of the resultvariable is True.
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding