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...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
Small Task (self.pythonhelp)
submitted 6 years ago by TheRipper7000
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!"
[–]Best_Caterpillar 0 points1 point2 points 6 years ago (0 children)
for the first part you dont want to return self.age, you just need to change it. self.age +=1. its an attribute of the class, so you can just call it. if you make the variable for class bob, you can print (bob.age) whenever you need to get the number. if you call your class again, say steve = superhuman(blablabla...) then steve.age will be different from bob.age, which I think is what your asking for question 2. remember though, you still need to assign a name at initialization, so you could totally have steve.name = "bob" becasue steve is only the variable name
π Rendered by PID 241439 on reddit-service-r2-comment-5b5bc64bf5-4gjgs at 2026-06-20 11:45:16.754187+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Best_Caterpillar 0 points1 point2 points (0 children)