Hello, when I run the following code why does every item in fruits start on its own line?:
fruits = ['banana', 'apple', 'orange', 'tomato', 'pear', 'grape'] print 'You have...' for f in fruits: if f == 'tomato': print 'A tomato is not a fruit!' # (It actually is.) break print 'A', f else: print 'A fine selection of fruits!'
If I add a comma after the f in print 'A'f, then everything prints on the same line. I thought the comma should cause each item to go on its own line as opposed to causing it all to be on one line. Can someone please explain this to me? Thanks in advance.