I just started on python and since I started a new calculator project, pyCharm spits out none after everything. I\'m not sure what\'s causing this error, I would appreciate
The function signature for input is input([prompt])
. The brackets indicate that a prompt is optional but basically input
is expecting you to give a string to print out. Instead, you are giving it a print()
statement. The return value of a print statement is None
so that's getting outputted as the prompt by the input statement.
Note, it is also bad practice to have an except
statement without specifying an error type. Without specifying a type, the except
will trigger for any error (for example, it triggered when I tried running your code before adding in your functions like multi
). I think you want except ValueError
here.
Try removing the print statement in the input.
Instead of input(print("Would you like to continue, yes or no?"))
, Try
input("Would you like to continue, yes or no?")
That is what i do
Remove print
statements from input
calls:
input(print("What's your first number?"))
-> input("What's your first number?\n")
or input("Your first number: ")
That None
is the return value of print
function that is displayed by input
function.