Output showing "None" in Terminal

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Mon Aug 24 16:53:02 EDT 2020


On 2020-08-24 at 06:12:11 -0700,
Py Noob <pynoob76 at gmail.com> wrote:

> i'm new to python and would like some help with something i was working on
> from a tutorial. I'm using VScode with 3.7.0 version on Windows 7. Below is
> my code and the terminal is showing the word "None" everytime I execute my
> code.

> if selection == "mi":
>     n = int(input(print("Please enter distance in miles: ")))

You've got a couple of lines like that:  input(print(...)).  The print
function prints the string and None, and then the input function prints
the None.

> answer = km_mi

As Calvin pointed out, this is likely not what you want, either.

-- 
“Whoever undertakes to set himself up as a
judge of Truth and Knowledge is shipwrecked
by the laughter of the gods.” – Albert Einstein
Dan Sommers, http://www.tombstonezero.net/dan


More information about the Python-list mailing list