Skip to content

Commit 2d02299

Browse files
authored
Merge pull request #107 from tyler-le/tle-variable-type
print variable types
2 parents 72c69c0 + 6a96efe commit 2d02299

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

variable_type.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Define variables of different types
2+
my_int = 10
3+
my_float = 3.14
4+
my_string = 'hello world'
5+
my_bool = True
6+
my_list = [1, 2, 3, 4]
7+
my_tuple = (5, 6, 7, 8)
8+
my_dict = {'a': 1, 'b': 2, 'c': 3}
9+
10+
# Print the types of each variable
11+
print(type(my_int)) # Output: <class 'int'>
12+
print(type(my_float)) # Output: <class 'float'>
13+
print(type(my_string)) # Output: <class 'str'>
14+
print(type(my_bool)) # Output: <class 'bool'>
15+
print(type(my_list)) # Output: <class 'list'>
16+
print(type(my_tuple)) # Output: <class 'tuple'>
17+
print(type(my_dict)) # Output: <class 'dict'>

0 commit comments

Comments
 (0)