-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_types.py
59 lines (34 loc) · 1.05 KB
/
data_types.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#data type is important concept in programming language ans so is it in python because every input we take from user and give result to them is certain tye of data
#variables stores data in different data types
#Text type: str
#Numeric type : int, float, complex
#Sequence type: ;ist, tuple, range
#Mapping type : dict
#Set type : set, frizenset
#Boolean type : bool
#Binary type : bytes, bytearray, memoryview
#type() method can be used to get data type of any variable
a = "Hello World" #str
b = 20 #int
c = 20.20 #float
d = 32j #complex
e = ["apple","pear","cherry","banana"] #list
f = ("apple","pear","cherry","banana") #tuple
g = range(6) #range
h = {'name' : 'Sammy' , 'age' : 23} #dict
i = {"apple","pear","cherry","banana"} #set
j = ({"apple","pear","cherry","banana"}) #frozenset
k = True
l = False # bool
print(type(a))
print(type(b))
print(type(c))
print(type(d))
print(type(e))
print(type(f))
print(type(g))
print(type(h))
print(type(i))
print(type(j))
print(type(k))
print(type(l))