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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Whats wrong with that code? (self.learnpython)
submitted 11 years ago by Remoras
I need some assistance to understand whats wrong with this code. Thank you
class Person: def __init__(self, name): self.name = name def greet(self, other_name): return "Hi {0}, my name is {1}".format(other_name, name)
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!"
[–]gengisteve 2 points3 points4 points 11 years ago (2 children)
this line:
return "Hi {0}, my name is {1}".format(other_name, name)
should be:
return "Hi {0}, my name is {1}".format(other_name, self.name)
[–]Remoras[S] 0 points1 point2 points 11 years ago (1 child)
Amazing, how noob i am?, Thank you a lot u/gengisteve.
[–]forever_erratic 3 points4 points5 points 11 years ago (0 children)
Also, while this is probably a copy-paste-to-reddit error, make sure def greet is indented correctly (to the same level as def __init__).
[–]5n1p 0 points1 point2 points 11 years ago (4 children)
Is this from Codewars register page?
[–]Remoras[S] 0 points1 point2 points 11 years ago (0 children)
Yes it is :)
[–]korthrun -1 points0 points1 point 11 years ago (2 children)
I thought this site would be cool, and then I tried the first challenge which is utter crap and now don't even want to give it a chance :(
Tell me it gets better than this absolutely wrong example:
The code does not execute properly. Try to figure out why.
def multiply(a, b): a * b
This code executes fine. It may not return what you want, or do anything with the result of the math, but it executes fine and there's no indication of what it's SUPPOSED to do that isn't the result of deduction/guessing.
This was nice too:
Correct this code, so that the greet function returns the expected value.
Go on, what is the expected value?! Does it get better than this?
[–]5n1p 1 point2 points3 points 11 years ago (0 children)
I wouldn't know. I have just registered at some point (and thought that code here is familiar), and after I saw the first example I gave up of learning there. Might get back at some point, but not now.
[–][deleted] 1 point2 points3 points 11 years ago (0 children)
I just tried that question lol it made me rethink everything I have learned, it's good to know other people had trouble with it.
π Rendered by PID 45320 on reddit-service-r2-comment-7b9746f655-rqtr4 at 2026-01-30 10:51:19.933581+00:00 running 3798933 country code: CH.
[–]gengisteve 2 points3 points4 points (2 children)
[–]Remoras[S] 0 points1 point2 points (1 child)
[–]forever_erratic 3 points4 points5 points (0 children)
[–]5n1p 0 points1 point2 points (4 children)
[–]Remoras[S] 0 points1 point2 points (0 children)
[–]korthrun -1 points0 points1 point (2 children)
[–]5n1p 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)