Python
Python
"""
- Numeric Data
- Integer
- Sequence Data
- List
- Tuple
- String
- Mapping Data
- Dictionary
- Set
- Boolean
"""
#type() function:
"""
"""
a=10.7
print(type(a))
#id() function
"""
"""
print(id(a))
#Integer
"""
- This data type used to represent +ve, -ve & zero numeric data
"""
a=10
print(type(a))
"""
- This data type used to represent +ve, -ve & zero data
"""
a=10.7
b=12.5
c=10.0
print(type(a))
print(type(b))
print(type(c))
#Complex Number
"""
- Syntax
a+bj
"""
a=5+6j
print(type(a))
#LIST
"""
"""
L=[]
print(type(L))
M=[10,12,14,16,18,20]
N=["Lucky",18,"XI-A",90.5]
print(type(M))
print(type(N))
M[2]=100
print(type(M))
#indexing
# 0 1 2 3 4 5
M=[10,12,14,16,18,20]
# -6 -5 -4 -3 -2 -1
print(M[1])
print(M[-5])
#TUPLE
"""
"""
L=()
print(type(L))
M=(10,12,14,16,18,20)
N=("Lucky",18,"XI-A",90.5)
print(type(M))
print(type(N))
#STRING
"""
- It is array of characters.
- It is also immutable.
or single qoutes.
"""
A="Manthan"
B='Manthan'
C='''Manthan'''
print(type(A))
print(type(B))
print(type(C))
"""
by colon :
"""
D={}
print(type(D))
T={1:"Aditya",2:"Bhuvan",3:"Nishant"}
print(type(T))
print(len(T))
#SET
"""
"""
D=set()
print(type(D))
print(D)
T={10,20,30,10,40,30}
print(T)
print(type(T))
"""
- For Example:
on value of a & b
"""
a=10
b=6
print(a>b)
print(not True)
print(True or False)
print(False or False)
#input() function :
"""
c=a+b
print("Value of c= ",c)
#Typecasting- str->int
c=a+b
print("Value of c= ",c)
#Typecasting- str->float
c=a+b
print("Value of c= ",c)
#Type conversion:
a=1
b=2.3
c=a+b
print("value of c: ",c)