I have some code similar to the following:
test_1 = 'bob'
test_2 = 'jeff'
test_1 += "-" + test_2 + "\n"
Output:
bob- jeff\n
I'd like to have the same functionality but using the .format
method.
This is what I have so far:
test_1 = "{}{} {}\n".format(test_1, "-", test_2)
Which produces the same output, but is there a better/more efficient way of using .format.
in this case?