Friday, June 02, 2006

First interaction with Python

Having not read any manuals, here's my first interaction with Python on our family iMac at home:

masood-mortazavis-imac-g5:~ masood$ python
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+1
2
>>> 1./3.
0.33333333333333331
>>> 2./6.
0.33333333333333331
>>> 2./3./1.
0.66666666666666663
>>> 0.9999**99
0.99014835352672459
>>> .99999**10000
0.90483696561475935
>>> .5**99
1.5777218104420236e-30
>>> exit
'Use Ctrl-D (i.e. EOF) to exit.'
>>> ^D
masood-mortazavis-imac-g5:~ masood$


Sounds like a pretty handy calculator to me but I'm sure it can do much more!

No comments: