+ 13
Hey! You know there are several ways to do string formatting..
The old one:😑 x = "test string %s" % ("one") The new one:😊 x = "test string {x}".format(x = "one") Literal string interpolation:😀 x = f'test string {"one"}' And by Template String:😏 from string import Template t = Template('test string $var') t.substitute(var="one") print(t) # all outputs will be "test string one" i hope u liked it😀
5 ответов
+ 4
Thanks for sharing!
+ 2
It's a nice information. thanks for sharing.
+ 2
Good info!.. Thanks for sharing. Abhishek Verma
+ 1
thank you
+ 1
Ohhh! Nice, good info!