Home arrow Python arrow Page 6 - Python Conditionals, Lists, Dictionaries, and Operators

Operators - Python

In our last article we learned how to get input from the user, store data in a variable, and work with some basic operators to manipulate that data. In this article we will learn to use Conditional Statements and possibly create functions. So wipe that mustard off your chin, clean the dishes, and let's get to work.

TABLE OF CONTENTS:
  1. Python Conditionals, Lists, Dictionaries, and Operators
  2. Elif
  3. Lists
  4. Tuples
  5. Dictionaries
  6. Operators
By: James Payne
Rating: starstarstarstarstar / 5
November 26, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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



 
 
>>> More Python Articles          >>> More By James Payne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PYTHON ARTICLES

- Python Big Data Company Gets DARPA Funding
- Python 32 Now Available
- Final Alpha for Python 3.2 is Released
- Python 3.1: String Formatting
- Python 3.1: Strings and Quotes
- Python 3.1: Programming Basics and Strings
- Tuples and Other Python Object Types
- The Dictionary Python Object Type
- String and List Python Object Types
- Introducing Python Object Types
- Mobile Programming using PyS60: Advanced UI ...
- Nested Functions in Python
- Python Parameters, Functions and Arguments
- Python Statements and Functions
- Statements and Iterators in Python

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: