Rosalee Dubberly wrote: > ## Now I am trying to modify the function to replace eggs with toast > and spam with jelly. I have spent days and nothing works. Can you send > me in the right direction??
The obvious answer (that has already been mentioned) is to simply replace the words in the actual program with their substitutes. However, this is so obvious I sincerely hope that you don't mean this by the question. The right direction, as I understand it, would be to set the text to be printed in a variable, which can then be passed to the function. This will allow you to change the text to whatever you want easily, as well as including the possibility for user input later. An example is attached, so you can try to work it out yourself without seeing it. Dan
def firstpart(success,fail): for n in range(0, 55): if n % 3 == 0 or n % 7 == 0 or n % 11 == 0: print n,"-",success else: print n,"-",fail firstpart("yes","no")
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor