Home arrow Python arrow Page 6 - Python 101 (part 1): Snake Eyes

Adding Things Up - Python

Known for its power, flexibility and elegance - much like its namesake - Python is one of the most interesting programming languages around. In this introductory tutorial, find out how learning Python will earn you respect, affection and bags of money. Oh yeah...you might also learn a little bit about the origins, features and syntactical rules of the language.

TABLE OF CONTENTS:
  1. Python 101 (part 1): Snake Eyes
  2. The Jedi Master Speaks
  3. Start It Up
  4. Dissecting A Python...Program
  5. Milk And Toast And Honey
  6. Adding Things Up
By: Vikram Vaswani, (c) Melonfire
Rating: starstarstarstarstar / 15
May 29, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Here's another program, this one performing an arithmetic operation on a variable and displaying the result.

>>> num1 = 10 >>> num2 = 5 >>> num3 = num1 + num2 >>> num3 15 >>>
Note that Python also allows you to display the value of a variable (in the command line interpreter only) by stating the variable name without a preceding print() function call.

Finally, Python also allows you to simultaneously assign a value to multiple variables - check it out.

>>> huey = dewey = louie = 75 >>> dewey 75 >>> louie 75 >>>
And that's about it for this introduction to Python. In this article, I've provided a brief history of Python, and explained some of the features which make it so popular among discerning developers. I've also discussed the two methods available to run a Python program, demonstrated the print() function, and offered some insight into the rules governing Python variables.

In the next article, I'll be delving deeper into Python's data structures and built-in objects - numbers and - together with a closer look at the various arithmetic and comparison operators. See you then!

 
 
>>> More Python Articles          >>> More By Vikram Vaswani, (c) Melonfire
 

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: