[Idle-dev] problem with set(...) in tutor
Przemyslaw Kisicki
logan at mat.uni.torun.pl
Mon Mar 14 14:12:24 CET 2005
I use:
--------------------------------------------------------------------------------
Python 2.3.4 (#2, Aug 19 2004, 15:49:40) [GCC 3.4.1 (Mandrakelinux (Alpha
3.4.1-3mdk)] on linux2 ... IDLE 1.0.3
--------------------------------------------------------------------------------
I was trying to write:
--------------------------------------------------------------------------------
>>> basket=['apple','orange','apple','pear','orange','banana']
>>> fruits=set(basket)
--------------------------------------------------------------------------------
and I get:
--------------------------------------------------------------------------------
Traceback (most recent call last): File "<pyshell#322>", line 1, in
-toplevel- fruits=set(basket) NameError: name 'set' is not defined
>>>
--------------------------------------------------------------------------------
What's wrong? How to use sets?
Logan
More information about the IDLE-dev
mailing list