Wednesday, August 28, 2013

Simple Equations

Now that we know how to print one line sentences on the terminal,
lets try and do something more.

Python can also be used to solve mathematical equations.
Lets start with the basic equations of all!
Lets use Python as a Calculator!

2+3 gives 5 on a Calculator,
Similarly "2+3" on the Python terminal gives 5 too!!
 to get this, we just type 
">>2+3"



Now press enter and check the output!



You can also try out various other simple equations as


You might have a doubt when it comes to the last two outputs..
Why 2 for 6/3 and 2.0 for 6.0/3.0.
This will be explained in the following Blogs.

No comments:

Post a Comment