| | |
Why a Set?
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Sep 2005
Posts: 133
Reputation:
Solved Threads: 58
Hi!
Did you have a look at the python-docs?
This should make clear that sets are really useful
Regards, mawe
Did you have a look at the python-docs?
This should make clear that sets are really useful

Regards, mawe
•
•
Join Date: Jan 2006
Posts: 2
Reputation:
Solved Threads: 2
•
•
•
•
Originally Posted by bumsfeld
Thank you mawe,
so when I take the list with duplicates and make it one set then the duplicates are gone. How can I find out which were those duplicates?
which returns the number of i's for which somelist[i] == x :
Python Syntax (Toggle Plain Text)
l=list('a list of characterstrings') for item in set(l): print item,'counted',l.count(item),'times'
Python Syntax (Toggle Plain Text)
a counted 3 times counted 3 times c counted 2 times e counted 1 times ...
![]() |
Similar Threads
- Set, View, Change, or Remove Special Permissions for Files and Folders in Windows XP (Windows tips 'n' tweaks)
- Trying to set up wireless lan (Networking Hardware Configuration)
- beeing on dialup can i set up a outlook express email account (Windows NT / 2000 / XP)
- Airport Base Station Set Up??? (OS X)
- How can I set up my own email a/c with a domain name using microsoft outlook/express (Web Browsers)
- best chip set anyone? (Motherboards, CPUs and RAM)
- Set Precision in C++.NET? (C++)
- New Portal set up (DaniWeb Community Feedback)
Other Threads in the Python Forum
- Previous Thread: vba to python
- Next Thread: File Dialog window, save dialog window
| Thread Tools | Search this Thread |
Tag cloud for Python
ansi assignment avogadro backend beginner binary bluetooth character cmd code copy customdialog cx-freeze data decimals dictionary directory drive dynamic error examples excel exe file float format function gnu graphics gui heads homework http ideas import input java leftmouse line linux list lists logging loop module mouse number numbers output parsing path pointer port prime program programming progressbar projects push py2exe pygame pyglet pyqt python random recursion refresh schedule script scrolledtext sqlite statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial ubuntu unicode update urllib urllib2 variable ventrilo wikipedia windows write wxpython xlib






