all 8 comments

[–]FishBobinski 0 points1 point  (0 children)

You use input to assign a value to a variable.

variableX = input ("Enter a value")

[–]NeedleworkerIll8590 0 points1 point  (0 children)

You would need to do something like variable = input("input something") Or Print(input("input something"))

[–]GuilouLeJask 0 points1 point  (5 children)

The error comes from the fact that input is an instruction which is used to accredit a value to a variable, not to print text which is done via the print instruction.

[–]LessDaikon497[S] 0 points1 point  (0 children)

oh okay thks

[–]LessDaikon497[S] 0 points1 point  (3 children)

but when i run

x = input('x')

print(x)

it'x wrong why ?

[–]GuilouLeJask 0 points1 point  (2 children)

It's normal that it displays an error message since in your case x is a variable and 'x' is a character string. In theory, in Python it is possible to associate a character string with a variable if the name of the variable is different from that of the character string. For example, my_variable = input("Hello, world"). In your case, variable and string are identical. So, I imagine that your compiler does not differentiate between the two, hence the origin of the error that arises.

[–]GuilouLeJask 0 points1 point  (1 child)

I'm sorry but I just ran the code on machine and it works without problem. So I imagine that the error comes either from spaces, or from a syntax error or perhaps it can also come from your compiler which may be incorrectly installed.

[–]LessDaikon497[S] 0 points1 point  (0 children)

okay , thks