I have an empty string strLocation and I would like to insert the three variables x, y and z to make the string a location of a point which is (x,y,z). I know I cannot simply add 'x' 'y' and 'z' because that will just add the letters instead of the actual values they hold. What should I do?
-
possible duplicate of How to print a string followed by the result of a function in PythonkylieCatt– kylieCatt2015-08-20 14:43:55 +00:00Commented Aug 20, 2015 at 14:43
-
1possible duplicate of Python string formatting: % vs. .formatmkrieger1– mkrieger12015-08-20 14:46:55 +00:00Commented Aug 20, 2015 at 14:46
Add a comment
|
2 Answers
Something like
strLocation = "("+str(x)+","+str(y)+","+str(z)+")"
?
2 Comments
SuperBiasedMan
@Kroltan It doesn't, see this question for someone having that problem.
Kroltan
@SuperBiasedMan Thanks for the reference. Been using Javascript for too long :)