Python Forum

Full Version: Win10 Import math issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've just started learning to program. I am running Win10, Python 3.6.4

When I type in the following:
import math
math.sqrt(16)

I save and run it. I get a blank output. I should be getting 4. What am I doing wrong?
You need print(),when running it as a script.
import math

print(math.sqrt(16))
In interactive console(REPL) example ptpython(work perfect with cmder), IPython.
It will execute without print().
C:\
λ ptpython
>>> import math

>>> math.sqrt(16)
4.0
Thank you, I'll give it a try. Unfortunately, life is getting in the way of self-teaching / learning time.