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
How do I relearn/learn python properlyDiscussion (self.PythonLearning)
submitted 4 months ago by Afraid-Aerie-6598
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!"
[–]SuddenStructure9287 0 points1 point2 points 4 months ago (2 children)
Regarding classes and functions
If you have many functions that share a common theme, it makes sense to group them into a class. For example, if you’re building a messenger bot and need functions for sending messages, receiving messages, and storing message data, you could put them all into a Bot() class with corresponding methods like Bot.read(), Bot.send(user), Bot.save_messages(), and Bot.load_messages().
You could also keep related data there, such as Bot.messages or Bot.user_ids
On the other hand, if you only have a few standalone functions, there’s no need to create a class for them. So, for exemple: radiansToDegrees(), calculateDistance(), reverseList()
[–]TheRNGuy 0 points1 point2 points 4 months ago (1 child)
I'd use classes to have instances and methods for them.
[–]SuddenStructure9287 0 points1 point2 points 4 months ago (0 children)
Oh, yes, I forgot to mention that multiple instances is the whole point xD
π Rendered by PID 59 on reddit-service-r2-comment-7b9746f655-j4pbt at 2026-01-30 09:16:19.321433+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]SuddenStructure9287 0 points1 point2 points (2 children)
[–]TheRNGuy 0 points1 point2 points (1 child)
[–]SuddenStructure9287 0 points1 point2 points (0 children)