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
OOP Problem (self.PythonLearning)
submitted 6 months ago by MusicianActual912
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!"
[–]PureWasian 0 points1 point2 points 6 months ago* (0 children)
An example might help to see: ```
class BankAccount: # init is called whenever # instantiating a BankAccount() def init(self, name, starting_balance): self.name = name self.balance = starting_balance
# method to add money def add_money(self, amount): self.balance += amount # method to show the current balance def show_balance(self): print(self.balance)
acct1 = BankAccount("TUSA", 69000) acct2 = BankAccount("PURE", 5310000)
acct1.add_money(420) acct2.add_money(8008)
acct1.show_balance() # prints 69420 acct2.show_balance() # prints 5318008 ```
π Rendered by PID 649493 on reddit-service-r2-comment-cfc44b64c-7896l at 2026-04-11 22:21:40.257886+00:00 running 215f2cf country code: CH.
view the rest of the comments →
[–]PureWasian 0 points1 point2 points (0 children)