-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprimitiveTypes.py
More file actions
72 lines (47 loc) · 944 Bytes
/
Copy pathprimitiveTypes.py
File metadata and controls
72 lines (47 loc) · 944 Bytes
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
60
61
62
63
64
65
66
67
68
69
70
71
72
# Variables
Count = 1000
print("variable :",Count)
# DataTypes / Primitive Types
# Text Type: str
x = "Hello World"
print("str :", x)
# Numeric Types: int, float, complex
a = 10
print("int :",a)
b=1.4
print("float :",b)
c=5j
print("complex :",c)
# Sequence Types: list, tuple, range
#list
d = ["Nirav","P","Kukadiya"]
print("List :",d)
print("type of d",type(d))
#tuple
e = ("tuple","example")
print("tuple", e)
#range
f = range(2,100)
print("range",f)
# Mapping Type: dict
g={"Name":"John","Age":"30"}
print("dict :",g)
# Set Types: set, frozenset
#set
h={"Cycle","byk","car"}
print("set : ", h)
#frozenset
i = frozenset({"google","Yahoo","Bing"})
print("Frozenset :",i)
# Boolean Type: bool
j = True
print("boolean :",j)
# Binary Types: bytes, bytearray, memoryview
k=b"Hello World"
print("bytes :",k)
#bytearray
L= bytearray(5)
print("bytearray : ", L)
#memoryView
M= memoryview(bytes(5))
print("memoryview : ", M)