Monday, May 12, 2014

Print and basic mathematical operations

Printing and basic mathematical operation:

Command print is use to print the result.

The first two commands are general print instructions for printing number. Print 54 has just printed only number 54.

Next three commands are used for printing the the resultant numbers after mathematical numbers.

"**" this command is used for power operation. 2**5 = 2^5 = 32
5**2 = 5^2 = 25

the next command is Division command here the resultant is always the greatest integer value [35/5] = 7
[32/6]=5
this is because the both operands are integers thus it will return an integer value.

last command (modular operator) is used here is remainder operator displaying the remainder of two operand.

clearing command line


After you have installed the Interpreter now lets start with basic mathematical operations.

Introduction:  After opening the python command line, you will see the command prompt.
If you are using windows, type the following command to clear the screen

import os
os.system("cls")

if you are using linux or mac then the following may work

import os
os.system("clear")

the above code will clear your screen and there will be only a command prompt.
however clearing the window is just not mandatory. It depends on user wether he wants to clear the screen or not.





Download and Install

DAY 1:

Python is an easy learning programming language. It has high level data structures which is quite efficient and widely used. It lets you work quickly and

This tutorial is for those who want to learn python fast and in efficient way.

Pre-requisite: If you are familiar with other programming language then its going to be quite easy. If not, no worry you can still learn it.

Download Python 2.7.3.
A I have been using this version of python thus it would be easy for me to make you learn.

Install the Python interpreter on your system.Interpreter reads the python programs and carries out their instruction.

Be ready to learn.