+ 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 Respostas
+ 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!