text="Qmfbtf fbu nf"
for f in text:
for f in text: is a variable name; you could have named it anything else and the loop would not have changed. This would be the same:
for character in text:
because that's exactly what the loop does; iterate over every character in the string
You'd have to test if that character is the letter
for character in text: if character == 'f': print 'f'
You could also use the
str.count() method to count how many times
print 'f\n' * text.count('f')
f plus a newline, as many times as there are
'f' letters in your input text.