Friday, January 10, 2014

Basics part-3 | Numbers

Hello.... Friends, today we are going to discs about the another data type i.e Numbers. So in this tut we study about what are the operations on Numbers & operations.on numbers, types of Numbers like integers, floats, long,Complex etc in python & much more

On numbers we can perform various operations like:
if we talk about operations on numbers then we can discus about operators
so there are  various types of operators :

  1. Arithmetic operators :
  2. Comparison operators:
  3. Assignment operators:
  4. Bitwise operators:
  5. logical operators 


1. Arithmetic operators :
additions(+), subtractions(-), multiplication(*), division(/)


we can see we can directly add, sub,mult,div any numbers but in division you can see no any decimal no. but if we use decimal no. for additions, Subtractions, multiplications,divisions, then we get the result in decimal no.

2. Comparison operators: 
equal to ( == ), not equal to ( !=), grater than ( >), less than (<), grater than equal to ( >=), less than equal to (<=),



3. Assignment operators:

assignment operators are similar to comparison operators but in this operators the value is stored in the different operators like as 

=, +=, -=,*=,/=, %=,**=,//=

4. Bitwise operators:

bitwise operators are like 

&, |, ^, ~, <<, >>,

5. logical operators:

logical operators are like  and, or, not


Note: ** (double *) is used for raise to the power ,

Note : Some operators also used in numbers as well as strings too.

No comments:

Post a Comment