In [ ]:
import numpy as np
In [ ]:
# int and float
a = 5
b = 2.0
print(type(a), type(b))
<class 'int'> <class 'float'>
In [ ]:
# remainder
print(7 % 2)
1
In [ ]:
#boolean
x, y = 3, 5
print(x != y)
print (x > y)
True
False
In [ ]:
#string
s = 'BANA 410'
print(len(s))
8
In [ ]:
#string manipulation
s.lower()
Out[ ]:
'bana 410'
In [ ]:
#list
l = [3.2, 1.5, 9.0]
l.append(7.7) #adding to the list
l
Out[ ]:
[3.2, 1.5, 9.0, 7.7]
In [ ]:
# change data typr
t= 16
float(16)
Out[ ]:
16.0
In [ ]: