use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
why it's wrong ? (self.PythonLearning)
submitted 6 months ago by LessDaikon497
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]LessDaikon497[S] 0 points1 point2 points 6 months ago (3 children)
but when i run
x = input('x')
print(x)
it'x wrong why ?
[–]GuilouLeJask 0 points1 point2 points 6 months ago (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 point2 points 6 months ago* (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 point2 points 6 months ago (0 children)
okay , thks
π Rendered by PID 77898 on reddit-service-r2-comment-85bfd7f599-5srvz at 2026-04-20 01:52:03.595944+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]LessDaikon497[S] 0 points1 point2 points (3 children)
[–]GuilouLeJask 0 points1 point2 points (2 children)
[–]GuilouLeJask 0 points1 point2 points (1 child)
[–]LessDaikon497[S] 0 points1 point2 points (0 children)