Skip to main content

Basic Knowledge of Python part 1

Basic Mathematics equations using Python-

As we know python is a simple and easy to learn programming language. In this section we learn how to done mathematics equations using python. To perform this we use our basic operators +,-,/,* . 
To perform python we have to open python interpreter. In this interpreter you can type simple equation like 5+5, 4/2 etc. For example:


The integer number (e.g. 1,2,3....) have type int and the number with fractional part (e.g. 2.5,2.1,4.5...) have type float.

Note:- The division type always returns float.

To get only an integer result of division you can use the // operator and to get remainder from division result you can use % operator.


In python you can easily calculate power of the number by using ** operator.


Like this you can easily calculate mathematics equation. Now we see how to find area of rectangle. Area = length*width is the formula to find area of rectangle.


Here '=' sign is used to store value to the variable. You can also calculate area using fractional point.



Comments

Popular posts from this blog

Python | Introduction

Python is developed by Guido van Rossum . Guido van Rossum started implementing python in 1989. Python is very simple programming language so if you are new to programming, you can learn python without facing any issue. Features of Python Free and Open Source -                                                                                      Python is a open source language. We can easily install python.It is freely available at python's official website . High level language -                                                                                     ...

Python Version List

Python Version List  Python Versions Released Date   Python 1.0  January 1994  Python 1.5  December 31, 1997  Python 1.6  September 5, 2000  Python 2.0  October 16, 2000  Python 2.1    April 17, 2001   Python 2.2  December 21, 2001   Python 2.3  July 29, 2003   Python 2.4    November 30, 2004   Python 2.5    September 20, 2006   Python 2.6    October 1, 2008   Python 2.7    July 3, 2010   Python 3.0  December 3, 2008   Python 3.1    June 27, 2009   Python 3.2    February 20, 2011   Python 3.3    September 29, 2012   Python 3.4    March 16, 2014  Python 3.5    September 13, 2015  Python 3.6    December 23, 2016  Python 3.7    June 27, 2018 Prev Topic    Next Topic