DEV Community

Cover image for One annoying difference between python versions 3.5 and 3.6
Matt Ellen-Tsivintzeli
Matt Ellen-Tsivintzeli

Posted on

3 1

One annoying difference between python versions 3.5 and 3.6

Back in the ancient time, the olden days, all the way back in March of 2019, there was python 3.5.7.

Back in those days there were no f-strings. No, if you wanted to interpolate your variables into a string the closest you could get to f-strings was this:

circumference = 19
radius = circumference/math.pi/2
area = math.pi*radius*radius
circledata = 'circumference: {circumference}, radius: {radius}, area: {area}'.format(**{'circumference':circumference, 'radius':radius, 'area':area})
Enter fullscreen mode Exit fullscreen mode

Behold the abomination! What a mess.

Now? Oh now! What a wonder that has been bestowed upon us. THE F-STRING. Behold!

circumference = 19
radius = circumference/math.pi/2
area = math.pi*radius*radius
circledata = f'circumference: {circumference}, radius: {radius}, area: {area}'
Enter fullscreen mode Exit fullscreen mode

Succinct and marvellous.

Why should I bring this up? Well, upon mine laptop I am blessèd with python 3.7. Yet. YET! My raspberry pi suffers in the gutter, hope lies dashed upon the pavement, with python 3.5.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay