Python
  Home arrow Python arrow Page 5 - Python Sets
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

Python Sets
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2007-12-03

    Table of Contents:
  • Python Sets
  • Adding to a Set
  • Copying Sets and Testing for Membership
  • Removing Data from A Set
  • Don't Make Me Repeat Myself!
  • Using Operators on Sets

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Python Sets - Don't Make Me Repeat Myself!


    (Page 5 of 6 )

    You can also perform loops on Sets. Just keep in mind that Sets have no specific order.


    usr/local/bin/python


    bigword = Set ("acetylsalicyclic")


    for n in bigword:

    print n,

    This will print out every letter in the word acetylsalicyclic. Again since there is no order in Sets, it will print the letters out randomly:

      a t y e c l a s i l c c t y i c

    More Python Articles
    More By James Payne


       · I am curious, Why didn't the author use the Python shell for the tutorials?-...
       · Thanks for dropping by to read my article. In this issue we discuss Sets in Python;...
       · The tutorial didn't work for me.I got a message saying that "Set" was not...
       · I tested it on my end and it worked. Let me look into it a little more and get back...
       · Thanks James,Here is a bit more information for you. Hope it is useful.The error...
       · The reason it doesn't work is because the name of the function to create a set is...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway