Tutorialslot.com

youtube facebook twitter gmail pinterest

Numbers in python

Objects for numbers are created once values are assigned to them.The reference of a number object can also be deleted by using "del" statement.
The syntax for "del" statement is,
del var1[,var2[,var3[....,varN]]]]

Example for del:
del var
del var_a, var_b

Numbers are classified into various types:
1)integer
2)float
3)long
4)complex

1)Integer:
It can be defined by the keyword "int".They can be evaluated in both positive and negative numbers. It is represented only as whole numbers without any decimal points.

2)Float:
Float represents the floating point numbers.They are used to define the real numbers which consists of a decimal point values.They are also called as "floats".

3)Long:
They are also same as the integers but with unlimited size.They are also called as "longs"

4)Complex:
COmplex numbers consists of real part and the imaginary part.It represents value in the form of expressions.It is mostly not used in python.

Example for Numbers:
n=1
n1=5.5
a=33.6j
print(n)
print(n1)
print(a)



Advertisement Powered By Google Adsense






IF YOU LIKE THIS TUTORIALS PLEASE SHARE

Share on whatsapp

POPULAR TAGS

python python tutorial learn python learning python python code learning java python language python documentation python tutor python basics python download python online python for dummies how to learn python