Posts tagged "python"
Tip: when adding a number to the end of a string in Python, you can surround the number with backticks in order to automatically convert it to a string (rather than using str()). For example:
num = 10
my_string += `num`
Incidentally, I learned this from Oliver Crow’s article on Efficient String Concatenation in Python, which is a fantastic resource for anyone curious about the best way to combine strings in Python.