There are three methods.
name = "juniskw"
print("Hello %s!" % name)
f_nm = "jun"
l_nm = "iskw"
print( "Hello %s%s" % (f_nm,l_nm,) )
f_nm = "jun"
l_nm = "iskw"
print( "Hello %(first)s%(last)s!" % {'first':f_nm,'last':l_nm,} )
The output is the same in both cases ("Hello juniskw!"). Does it feel like using it properly according to the number to be substituted?
Recommended Posts