World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITians, only for AI Learners.
Designed by IITians, only for AI Learners.
New to InsideAIML? Create an account
Employer? Create an account
Download our e-book of Introduction To Python
4.5 (1,292 Ratings)
559 Learners
Balasaheb Garule
a year ago
n = 10000000000000000001
print(type(n))
<class 'int'>
fp = 3.14
print(type(fp))
<class 'float'>
c = 3+4j
print(type(c))
print(c.real)
print(c.imag)
<class 'complex'>
3.0
4.0
b = 0 > 1
print(type(b))
print(b)
<class 'bool'>
False
x = "AI"
y = -0
print(bool(x))
print(bool(y))
True
False
s1 = 'insideaiml'
s2 = "insideAIML"
print(type(s1))
print(type(s2))
print(s1)
print(s2)
<class 'str'>
<class 'str'>
insideaiml
insideAIML
s1 = “insideaiml”
s1[4]
d
list1 = [1, 'two', 3.0, True]
print(list1)
Output
[1, 'two', 3.0, True]
charlist = list(('i','n','s','i','d','e','a','i','m','l'))
print(charlist)
['i', 'n', 's', 'i', 'd', 'e', 'a', 'i', 'm', 'l']
month = ("Jan","Feb","March","April",”Jan”) #tuple example in python
print(type(month))
print(month)
<class 'tuple'>
('Jan', 'Feb', 'March', 'April',’Jan’)
mydict={1:2,2:4,3:9}
print(type(mydict))
print(mydict)
<class 'dict'>
{1: 2, 2: 4, 3: 9}
print(mydict[1])
2
numberset = {1,2,3,4,5,6,7,8,9,9,9,8}
print(type(numberset))
print(numberset)
<class 'set'>
{1, 2, 3, 4, 5, 6, 7, 8, 9}
numberset = set((1,2,3,4,5,6,7,8,9))
print(numberset)
{1, 2, 3, 4, 5, 6, 7, 8, 9}