Too many arrows?
Remote
Rodrigo 🐍🚀
@mathsppblog@fosstodon.org
mastodon 4.7.3Helping you take your Python 🐍 skills to the next level! 🚀
247 Followers
71 Following
9 Posts
Joined May 17, 2024
Write better Python 🐍🚀::
Read a Python deep dive every Monday 🐍🚀:
Open post
RE: @mathsppblog@fosstodon.org
I know I only ask random nonsensical questions.
Came up with 4 random ways to do this.
2, I recommend you use them (although 1 doesn't work!)
The other 2 are really cool — they use fixed points and `itertools.groupby` — but they'll be overkill 99.9% of times.
0
0
0
0
Open post
RE: @mathsppblog@fosstodon.org
Let the record show that, while I managed to start a number of interesting but useless discussions, I WAS able to prove the “someone else” wrong.
So, thank you, everyone!
0
0
0
0
Open post
Replying to
@yngvem @bmispelon yeah, exactly!
Using .split(" ") is closer, but then you also need to filter the empty strings, so something like
" ".join(filter(None, string.split(" ")))
is close...
But then, what if you had leading/trailing space? Then, it disappears! 😭
0
1
0
0
Open post
I'm trying to reach out to @charliermarsh@hachyderm.io because of the upcoming EuroPython conference.
Do I know anyone here who can help me get to him?
Thanks 🙏
0
0
1
0