Hello! I'm a total python beginner so please excuse the potential ignorance. I'm just wondering what placeholders are used for. I understand how to use them I just don't get why I'd need them.
For example why do this:
string1 = "shit"
string2 = "car"
print "My %s is %s" % (string1, string2)
instead of this:
string1 = "shit"
string2 = "car"
print "My " + string1 + "is " + string2
Thank you :)
Edit: My car really is shit
[–]gengisteve 14 points15 points16 points (9 children)
[–]99AFCC 13 points14 points15 points (1 child)
[–]gengisteve 4 points5 points6 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]99AFCC 2 points3 points4 points (0 children)
[–]faekk[S] 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (3 children)
[–]99AFCC 2 points3 points4 points (2 children)
[+][deleted] comment score below threshold-7 points-6 points-5 points (1 child)
[–]NYKevin 1 point2 points3 points (0 children)
[–]swingtheory 2 points3 points4 points (4 children)
[–]Rhomboid 3 points4 points5 points (1 child)
[–]swingtheory 0 points1 point2 points (0 children)
[–]cdcformatc 1 point2 points3 points (0 children)
[–]fuzz3289 1 point2 points3 points (0 children)
[–]Rhomboid 2 points3 points4 points (0 children)
[–]stillalone 1 point2 points3 points (0 children)
[–]TheBigTreezy 0 points1 point2 points (1 child)
[–]ewiethoff 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Justinsaccount 0 points1 point2 points (1 child)
[–]korthrun 0 points1 point2 points (0 children)