File tree 1 file changed +55
-0
lines changed
Article002 - Variables and Types
1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Str
2
+ x = "Hello World"
3
+ print (type (x ))
4
+
5
+ # Int
6
+ y = 20
7
+ print (type (y ))
8
+
9
+ # Float
10
+ z = 20.5
11
+ print (type (z ))
12
+
13
+ # Complex
14
+ a = 1j
15
+ print (type (a ))
16
+
17
+ # List
18
+ b = ["apple" , "banana" , "cherry" ]
19
+ print (type (b ))
20
+
21
+ # Tuple
22
+ c = ("apple" , "banana" , "cherry" )
23
+ print (type (c ))
24
+
25
+ # Range
26
+ d = range (6 )
27
+ print (type (d ))
28
+
29
+ # Dict
30
+ e = {"name" :"John" , "age" :36 }
31
+ print (type (e ))
32
+
33
+ # Set
34
+ f = {"apple" , "banana" , "cherry" }
35
+ print (type (f ))
36
+
37
+ # Frozenset
38
+ g = frozenset ({"apple" , "banana" , "cherry" })
39
+ print (type (g ))
40
+
41
+ # Bool
42
+ h = True
43
+ print (type (h ))
44
+
45
+ # Bytes
46
+ i = b"Hello"
47
+ print (type (i ))
48
+
49
+ # Bytearray
50
+ j = bytearray (5 )
51
+ print (type (j ))
52
+
53
+ # Memoryview
54
+ k = memoryview (bytes (5 ))
55
+ print (type (k ))
You can’t perform that action at this time.
0 commit comments