It has been a while i want to try Python programming. Too much things to learn lately. Today try to start smthing with Python.
Downloaded Python2.7 from web.
Try Writing Hello world>>> it is D*** straight forward
...
Just write..... 'Hello world' .......in GUI .
it Prompts .... Hello world .......
![](http://2.bp.blogspot.com/_cob59P2ESUg/TOeFqIVoxiI/AAAAAAAAAFQ/oexN4vUMt7U/s400/HelloWorld.jpg)
Hello World is done>>>>
Lets start Maths>>>>
Type 1+2 in GUI Gives 3
Type 1*2 in GUI Gives 2
Type 1/2 in GUI Gives 0 .Y? later find out <-------
Type 1-2 in GUI Gives 3
Why not try 3%2 in GUI. It Gives 1 as expected.
![](http://3.bp.blogspot.com/_cob59P2ESUg/TOeH0DUJhrI/AAAAAAAAAFY/AIcVQkCdGdM/s400/Maths.jpg)
let's search y 1/2 gives 0 rather than 0.5. How to do what i am suppose to get????
Try Type 1.0/2 in GUI Gives 0.5
Try Type 1/2.0 in GUI Gives 0.5
![](http://3.bp.blogspot.com/_cob59P2ESUg/TOeJPLJlGNI/AAAAAAAAAFg/gUl6BfR34pk/s400/Maths1.jpg)
Hmm!!!! Understand. HoHoHo>>>>>>
What about precedent>>>>>
lets Try>>>>
![](http://3.bp.blogspot.com/_cob59P2ESUg/TOeKz1dKvUI/AAAAAAAAAFo/p4qMdFOn_PI/s400/Precedent.jpg)
so precedent is still in order of * / + -
But Y 7.19999999999999 instead of 7.2 ? <-----
![](http://2.bp.blogspot.com/_cob59P2ESUg/TOeO-J6wWKI/AAAAAAAAAFw/h_obTtClf-c/s400/DecimalPlace.jpg)
That is!!! What the Heck????. Just use round() for watever u want . HoHoHo.
My head aching while reading python manual!!!!
Reference::: Python Manual
Let's try looping>>>>
Try with while loop
![](http://4.bp.blogspot.com/_cob59P2ESUg/TOiAsLOdHcI/AAAAAAAAAF4/Lcj6zTCMWUE/s400/Looping.jpg)
Lets try Calculator Program, Just +-*/,
![](http://1.bp.blogspot.com/_cob59P2ESUg/TPmU7CUdDmI/AAAAAAAAAGU/WYao495zelY/s400/Calculator.jpg)
And the output is
![](http://2.bp.blogspot.com/_cob59P2ESUg/TPmVM83XlRI/AAAAAAAAAGc/69L4sWENp6E/s400/Calculator_Shell_OP.jpg)
I can get 1/2=0.5 only if num1*1.0/num2 in the option4 .
Lets Study list now!
Program::
![](http://4.bp.blogspot.com/_cob59P2ESUg/TQtkkXoNwSI/AAAAAAAAAGk/AP62VLXTX4s/s400/list.jpg)
![](http://3.bp.blogspot.com/_cob59P2ESUg/TQtk4Oh9VgI/AAAAAAAAAGs/80ewsJTU2RY/s400/List_R.jpg)