Tuesday, January 13, 2009

Python Number and Expressions :

The interactive Python interpreter can be used as a powerful calculator.

Try the following : >>> 2 + 2

This should give you the answer 4. That wasn’t too hard.

Well, what about this : >>> 53672 + 235253 = 288925

Still not impressed? Admittedly, this is pretty standard stuff. (I’ll assume that you’ve used 
a calculator enough to know the difference between 1+2*3 and (1+2)*3.)

All the usual arith- metic operators work as expected—almost. There is one potential trap here, and that is integer division (in Python versions prior to 3.0) : >>> 1/2 = 0

Python Interactive Interpreter :

When you start up Python, you get a prompt similar to the following:

Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) 

[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin.

Type "help", "copyright", "credits" or "license" for more information. >>> 

■Note: The exact appearance of the interpreter and its error messages will depend on which version you are using.

It’s an interactive Python interpreter.

Just try the following :

>>> print "Hello, world!"

When you press the Enter key, the following output appears : Hello, world! >>>

Data Science - 103 (Kapil Sharma)

Cloud Computing Basic:-  In this the PC is on service provider data center and secuirty maintenance and upgrades are done by the service pro...