Skip to content

Commit d5b182d

Browse files
committed
Added variable examples in data_type.py
1 parent 906de9c commit d5b182d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

data_type.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var_1 = 1
2+
print(type(var_1)) # Integer type
3+
4+
var_2 = 1125685555555555555548962558
5+
print(var_2) # Large integer value
6+
7+
print(0b10) # Binary literal (2)
8+
print(0B10) # Binary literal (2)
9+
print(0o10) # Octal literal (8)
10+
print(0x10) # Hexadecimal literal (16)
11+
12+
c = 0.11
13+
print(type(c)) # Float type
14+
15+
d = 2 + 3j
16+
print(type(d)) # Complex type
17+
18+
e = {"name": "Amrata", "age": 20} # Dictionary with string keys
19+
print(type(e)) # Dictionary type
20+
21+
bool_var = True
22+
print(type(bool_var)) # Boolean type
23+
24+
name = "hello"
25+
print(type(name)) # String type
26+
27+
List = ["Amrata", 29, "BCS"]
28+
print(type(List)) # List type
29+
30+
Tuple = (5, 6, 9, 8)
31+
print(type(Tuple)) # Tuple type
32+
33+
set_var = {"Apple", "banana", "cherry"}
34+
print(type(set_var)) # Set type

0 commit comments

Comments
 (0)