-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_types.py
41 lines (31 loc) · 840 Bytes
/
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
# This program demonstrates different data types in Python.
# Integer
integer_variable = 10
print(f"Integer: {integer_variable}")
# Float
float_variable = 3.14
print(f"Float: {float_variable}")
# String
string_variable = "Hello, Python!"
print(f"String: {string_variable}")
# Boolean
boolean_variable = True
print(f"Boolean: {boolean_variable}")
# List
list_variable = [1, 2, 3, 4, 5]
print(f"List: {list_variable}")
# Tuple
tuple_variable = (1, "two", 3.0)
print(f"Tuple: {tuple_variable}")
# Dictionary
dictionary_variable = {"key1": "value1", "key2": 42, "key3": [1, 2, 3]}
print(f"Dictionary: {dictionary_variable}")
# Set
set_variable = {1, 2, 3, 4, 5}
print(f"Set: {set_variable}")
# NoneType
none_variable = None
print(f"NoneType: {none_variable}")
# Complex
complex_variable = 3 + 4j
print(f"Complex: {complex_variable}")