String interpolation is a useful feature in many programming languages which helps the developers to generate formatted messages easier. An example from C# 6 could read like:

var msg = $"Value of parameter {nameof(val)} is {val}";

Scala, Ruby and some other languages have similar features. Until recently Python was not one of them. However, the recently released version 3.6 introduced, at last, string interpolation. It can be used as demonstrated:

msg = f"From {start} to {finish} with some step={stepValue}"

More details can be found in PEP 498 . PyCharm IDE already supports this feature in its latest version.

Tags: computers
Categories: None |

0 comments have been posted.

Your email: we will send you a confirmation link to this address to confirm your identity and to prevent robot posting
Get in touch
Follow updates

Join our social networks and RSS feed to keep up to date with latest news and publications