+ 3
can someone please tell me what the error is? https://code.sololearn.com/cmydmr6VbQon/?ref=app
9 ответов
+ 4
the call is:
input() #<--no variables go in here
if you want, you can add a prompt:
input("Enter a number > ")
*Doesnt matter on SoloLearn though
If you just collect the input without assigning it, the computer will forget. So:
x = input("Enter a number > ")
*BUT a problem arises, youre adding x and a number at the end and by default, input returns a string. So you need to change the inputs type.
x = int(input("Enter a number > "))
Please go through the tutorial again.
+ 4
As swim stated, when you put the x in input() [you still have input(x)] you will get 0 in your output because the first thing your script does is assign x to 0.
Take x out of input(x)
+ 3
I am Russian and write through a translator, I do not fully understand what you mean by the word "swim" and "firat"
+ 3
"swim" is the mod who answered your post. "firat" is a common spelling mistake (for me). It should be "first"
+ 2
indent, you use input() not input () same goes for print. Also its a string, and your adding string to a integers, I'm surprised Sololearn did not raise any Syntax error on that one
+ 2
but I wrote input (x),but not input(x). Can you explain in more detail otherwise I'm confused please?
+ 2
Thank you, but how to make the program write the answer without zero? Well, that is, the program always puts the number zero before the answer. Why?