Another idea how to demonstrate empty string (and strings in general):

Prepare several cubic beads from FIMO and mark each of them with
characters (letters, digits and other curses from Unicode).
Prepare few wires.

Demonstrate strings by stringing together the beads on wires.
Show how strings could be concatenated, by tying together two wires with
beads.

Finally, show an empty string by showing a wire without beads.

                                       --- Omer

On Mon, 2005-12-12 at 15:59 +0200, Noam Raphael wrote:
> A possible way:
> 
> We can start from a problem. How can we write a program which gives
> you a string with all the digits from 1 to 9?
> 
> s = "1"
> for i in range(2,10):
>     s = s + str(i)
> 
> And if we want to change it to start from 3?
> 
> s = "3"
> for i in range(4,10):
>     s = s + str(i)
> 
> We can see that we need to change two places in our code. For this,
> people invented the empty string. We can add it to a string, and
> nothing happens! What's its length? 0!
> 
> s = ""
> for i in range(1, 10):
>     s = s + str(i)
> 
> Do you think it might work?
> 
> Noam
-- 
Jara Cimrman!  He is one of the unsung geniuses--scientist, engineer,
inventor and literary critic.
My own blog is at http://www.livejournal.com/users/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

לענות