ways to declare empty set variable

Chris cwitts at gmail.com
Tue Feb 12 08:57:27 EST 2008


On Feb 12, 3:45 pm, "Sun" <a... at hut.at> wrote:
> Maybe this is a very primative question, but I just get a bit confused about
> 'set' and 'Set' module in python.
>
> I understand 'set' is a build in type in python after 2.4(or 2.3) and Set a
> seperate module, anyhow, I gonna use build in 'set'.
>
> then the question is how can I declare a empty set variable as a 'var= []'
> do to a list variable?

>>> test = set()
>>> test
set([])
>>> type(test)
<type 'set'>

You looking for that ?



More information about the Python-list mailing list