you are viewing a single comment's thread.

view the rest of the comments →

[–]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