mansourjr.bsky.social
mansourjr.bsky.social
@mansourjr.bsky.social
Python tip:

You can call magic methods (aka dunder methods) directly - but you shouldn't.
They're meant to be called by the interpreter, and calling them directly hurts readability, skips additional checks, and causes undesired behavior.
December 30, 2023 at 11:35 PM
Python tip:

Python has a built-in method for returning a (pseudo) random element from a sequence - "random.choice".
December 30, 2023 at 8:07 AM
Python tip:

f-strings are the most popular way to format strings.
Did you know they can do more than just print out variable values?

For example, you can do an expression or call a function within them.
December 29, 2023 at 9:56 AM