Tomato shouldn't be here (18/14)


#1

The code below...

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.)
        
    print 'A', f
else:
    
    print 'A fine selection of fruits!'`

...gives this:

You have...
A banana
A apple
A orange
A tomato is not a fruit!
A tomato
A pear
A grape
A fine selection of fruits!
None

How to print "A tomato is not a fruit!" without "A tomato" ?


#2

if condition then do something, else do something else


#5