Member-only story

3 Python Tricks That Will Improve Your Code

Python is evolving — don’t get complacent

Roman Orac
Better Programming
3 min readJul 26, 2021

Photo by Michael Dziedzic on Unsplash

I’ve been coding in Python for more than 10 years. There was a time when I thought I knew it all, which was a clear sign I was getting complacent.

Then I decided to do a bit of research about Python improvements. Those 3.6, 3.7, 3.8 Python versions aren’t there for nothing, right?

After going through release notes, I found these neat tricks that I would like to share with you.

By reading this article, you’ll learn:

  • How to format big integers more clearly
  • A better way to work with file paths
  • The proper way of string formating

Here are few links that might interest you:

- Complete your Python analyses 10x faster with Mito [Product]- Free skill tests for Data Scientists & ML Engineers [Test]- All New Self-Driving Car Engineer Nanodegree [Course]

Would you like to read more such articles? If so, you can support me by clicking on any links above. Some of them are affiliate links, but you don’t need to buy anything.

1. Formatting big integers

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (7)

What are your thoughts?

Would it not be better to use “joinpath()” to create subfolders instead of using “/”. It kind of beats the purpose of using the “path” library as a cross-platform or -os alternative ?

6

There are lots of articles like this one. It's still worth skimming though, for example I still use os.path when pathlib might be more powerful, so your article is a good reminder.

5

Using underscore as a separator seems helpful.

6