On 2011-11-26 03:49, lina wrote:
for k, v in occurence.items():
print(v,k)
292 frozenset({66, 69})
222 frozenset({24, 27})
How can I let the result like:
292 {66,69}
222 {24,27}
don't output the frozenset
If you want to use your own output format you have to provide it.
For example, you could use a combination of string formatting and
".join()" to get what you want:
for k, v in occurence.items():
print("{0} {{{1}}}".format(v, ",".join([str(x) for x in k])))
Bye, Andreas
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor