mathsppblog's profile picture. Take your Python ๐Ÿ skills to the next level ๐Ÿš€!

Daily drop of Python knowledge http://mathspp.com/drops ๐Ÿ๐Ÿ’ง

Rodrigo ๐Ÿ๐Ÿš€

@mathsppblog

Take your Python ๐Ÿ skills to the next level ๐Ÿš€! Daily drop of Python knowledge http://mathspp.com/drops ๐Ÿ๐Ÿ’ง

Pinned

We did it! Largest computer programming lesson in the world!

mathsppblog's tweet image. We did it!

Largest computer programming lesson in the world!
mathsppblog's tweet image. We did it!

Largest computer programming lesson in the world!

Python has a very well-known naming convention: Names that start with a leading underscore are โ€œprivateโ€. This means the outside world has no business using them. E.g., attributes and methods starting with `_` in a class mean they're for that class only.

mathsppblog's tweet image. Python has a very well-known naming convention:

Names that start with a leading underscore are โ€œprivateโ€.

This means the outside world has no business using them.

E.g., attributes and methods starting with `_` in a class mean they're for that class only.

The methods `strftime` and `strptime` can be used to convert dates/times into strings and vice-versa. Here's a mnemonic to help you: ๐Ÿ‘‰ `strptime` has a โ€œPโ€ for โ€œParse date/timeโ€, so string -> date ๐Ÿ‘‰ `strftime` has an โ€œFโ€ for โ€œFormat date/timeโ€, so date -> string

mathsppblog's tweet image. The methods `strftime` and `strptime` can be used to convert dates/times into strings and vice-versa.

Here's a mnemonic to help you:

๐Ÿ‘‰ `strptime` has a โ€œPโ€ for โ€œParse date/timeโ€, so string -> date
๐Ÿ‘‰ `strftime` has an โ€œFโ€ for โ€œFormat date/timeโ€, so date -> string

A generator, duck typing, and a branchless conditional walk into a bar... You can read the rest of this Python joke here ๐Ÿ‘‰ mathspp.com/blog/a-generatโ€ฆ


The string method `str.split` has a parameter `maxsplit` that determines the maximum number of splits that will be performed. The returned list with the splits (and possibly the remainder of the string) has a maximum length of `maxsplit + 1`.

mathsppblog's tweet image. The string method `str.split` has a parameter `maxsplit` that determines the maximum number of splits that will be performed.

The returned list with the splits (and possibly the remainder of the string) has a maximum length of `maxsplit + 1`.

Yesterday's training culminated with creating a couple of projects (with uv). We then uploaded them to (Test) PyPI and we got people to install each other's apps and run them on their own computers. It was clearly a moment of *fun* for folks involved. ๐Ÿคฉ


I panicked when I saw this. I tend to associate Armin to Python. But this is JS. I'm sorry you have to use JS, Armin. โค๏ธโ€๐Ÿฉน Here's the Python behaviour:

mathsppblog's tweet image. I panicked when I saw this. I tend to associate Armin to Python. But this is JS. I'm sorry you have to use JS, Armin. โค๏ธโ€๐Ÿฉน

Here's the Python behaviour:

Got bitten by this again. Such a stupid API.

mitsuhiko's tweet image. Got bitten by this again. Such a stupid API.


Days 2 and 3 were a success, if I might say so myself. The grounded, fundamental approach to OOP resonated well with the participants. Even those who already knew OOP said they learned a lot by starting with the fundamentals! What a surprise! (Not...)


Live-coding during trainings + automatically syncing to git so everyone has access to what I'm typing = Very informative git history.

mathsppblog's tweet image. Live-coding during trainings + automatically syncing to git so everyone has access to what I'm typing =

Very informative git history.

Yesterday went well. Today I'm teaching OOP from the ground up. But like, REALLY from the ground up. Not just โ€œyou write class Something then __init__ and `self` is the first argument because reasonsโ€. Might turn this into a chapter for my book โ€œPydon'tsโ€, actually...

There's nothing quite like the excitement of being about to start a week-long Python training. Being this excited about my job feels illegal ๐Ÿคฃ



Loading...

Something went wrong.


Something went wrong.