开启python3.x
字符串新功能
在python 3.6增加了f-string,对比js:
//js
var a = "x"
`this is ${a}` //this is x
#python
a = "x"
f"this is {a}" #this is x
"this is %s" % a #this is x
在python 3.6增加了f-string,对比js:
//js
var a = "x"
`this is ${a}` //this is x
#python
a = "x"
f"this is {a}" #this is x
"this is %s" % a #this is x