[Tutor] FW: Frustrated Beginner

Daniel Watkins daniel at thewatkins.org.uk
Thu Sep 29 18:51:29 CEST 2005

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

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: firstpart.py
Type: text/x-python
Size: 206 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20050929/2485787e/firstpart.py

More information about the Tutor mailing list