I create a file using this code:
file = open("full_names.txt", "wb")
file.write("Bob Smith\nMichael Jackson\nTony Tiger\nWinston Churchill\nHenry Kissinger\nHamid Karzai\nJohn Major\nJohnny Quest")
file.close()
I then run the script to print the file to screen:
with open("full_names.txt", "rb") as f:
for line in f:
first, last = line.strip().split(" ")
print "Last Name: %r First Name: %r" % (last, first)
But the output shows up with quotes around the names, like this:
Last Name: 'Smith' First Name: 'Bob'
Does any one know why or how to get rid of them?