-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd_type.py
More file actions
65 lines (46 loc) · 980 Bytes
/
Copy pathd_type.py
File metadata and controls
65 lines (46 loc) · 980 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
name = "Hello"
age = 1
cgpe = 5.5
is_student = True
com = 1 + 5.5j
print(type(name))
print(type(age))
print(type(cgpe))
print(type(is_student))
print(type(com))
# ============================
# PYTHON DATA TYPES
# ============================
# 1. Numeric Data Types
a = 10 # int
b = 10.5 # float
c = 3 + 4j # complex
print(a, type(a))
print(b, type(b))
print(c, type(c))
# 2. String
name = "Python"
print(name, type(name))
# 3. Boolean
x = True
y = False
print(x, type(x))
print(y, type(y))
# 4. List (Ordered, Mutable)
numbers = [10, 20, 30]
print(numbers, type(numbers))
# 5. Tuple (Ordered, Immutable)
colors = ("Red", "Green", "Blue")
print(colors, type(colors))
# 6. Set (Unordered, No Duplicates)
fruits = {"Apple", "Banana", "Mango"}
print(fruits, type(fruits))
# 7. Dictionary (Key : Value)
student = {
"name": "John",
"age": 20
}
print(student, type(student))
# 8. NoneType
n = None
print(n, type(n))