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.

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs