guy keren <[EMAIL PROTECTED]> wrote:
This can be visualized in the following way:
4. the empty string realy confused them. since i didn't think about it in
advance, i was puzzled about how to explain what an empty string is.
need to prepare a good analogy for such abstract things next time (and
lets face it - there are no intuitive "empty strings" in real life.
no - a blank note is not exactly the same as an "empty string").
A string is a note which you can write words in it. an empty string is an empty note.
You lose some of the flexibility in this visualization (how can you change a letter if it is already written down? you don't erase and write in python, you just write over it., and, a note has a final size limitation, while a string, for any everyday usage, doesn't have one.)
you also lose the ability to explain:
>>> a = ""
>>> b = ""
>>> a == b
True
>>> a is b
True
>>> a = "1"+"2"
>>> b = "1"+"2"
>>> a == b
True
>>> a is b
False
but hopefully they will have a higher grasp of strings and objects when you'll have to deal with the above.
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping
