ACTIVITY 49 / 50
Try as many times as you needA module alias
Let’s understand
An import can give a module a short name: import math as m. The as keyword creates an alias; its functions stay the same. You now call the square root as m.sqrt. Choose clear names and use the chosen name consistently. An alias neither installs a package nor changes the module.
Listen to the explanation
Example
import math as numbers
print(numbers.floor(4.8))Import math as m. Read a non-negative number with float(input()) and print m.sqrt of it.
I need a hint
Start with import math as m, then call the function with a dot.
How to find an error
- Read the last line of the error message.
- Find the indicated line. Check quotes, parentheses and indentation.
- Change one thing and run again.
main.py
4 spaces
Your draft stays in this browser.
Result
PythonYour program’s output will appear here. Click Run.
Мой профиль