python wrote: > after del list , when I use it again, prompt 'not defined'.how could i > delete its element,but not itself?
This is a way: >>> a = range(10) >>> del a[:] >>> a [] >>> a.append(20) >>> a [20] Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list