Python
  Home arrow Python arrow Page 6 - Python Conditionals, Lists, Dictionari...
Dev Shed Forums 
Administration  
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
eWeek
 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 Conditionals, Lists, Dictionaries, and Operators
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2007-11-26

    Table of Contents:
  • Python Conditionals, Lists, Dictionaries, and Operators
  • Elif
  • Lists
  • Tuples
  • Dictionaries
  • Operators

  • 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

    Virtual Tradeshows by Ziff Davis Enterprise – A Unique Opportunity to Interact with IT Experts, Access Information, and Gain Insight on Today’s Trends in Technology Learn more

    Python Conditionals, Lists, Dictionaries, and Operators - Operators
    (Page 6 of 6 )

    The following is a list of operators you can use in Python:

     

    Symbol

    Type

    What it Does

    +

    Mathematical

    Addition

    -

    Mathematical

    Subtraction

    *

    Mathematical

    Multiplication

    /

    Mathematical

    Division

    //

    Mathematical

    Truncating Division

    **

    Mathematical

    Powers

    %

    Modulos

    Returns the remainder from a division

    <<

    Shift

    Left Shift

    >>

    Shift

    Right Shift

    &

    Logical

    And

    |

    Logical

    Or

    ^

    Logical

    Bitwise XOR

    ~

    Logical

    Bitwise Negation

    <

    Comparison

    Less than

    >

    Comparison

    Greater than

    '=='

    Comparison

    Equal to

    !=

    Comparison

    Not Equal To

    >=

    Comparison

    Greater than or Equal To

    <=

    Comparison

    Less than or Equal To

    '='

    Assignment

    Assigns a value

    +=

    Assignment

    Adds and assigns a value

    -=

    Assignment

    Subtracts and Assigns a value

    *=

    Assignment

    Multiplies and assigns a value

    /=

    Assignment

    Divides and assigns a value

    //=

    Assignment

    Truncate Divides and assigns a value

    **=

    Assignment

    Powers and assigns

    %=

    Assignment

    Modulus and assigns

    >>

    Assignment

    Shifts and assigns

    <<

    Assignment

    Shifts and assigns

    And

    Boolean


    Or

    Boolean


    Not

    Boolean


    Unfortunately I don't have time to discuss these operators in this tutorial, but join me for the next episode where I will be discussing Sets and how to manipulate data with the rest of these operators. Thanks again for stopping by and remember to check in often for new series from yours truly and others.

    Till then...


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · In [7]: suess = ['I', 'like', 'green', 'eggs', 'and', 'spam']In [8]: print...
       · I used a combo box in form along with text boxes.. now when the user submit the...
     

       

    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...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




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