We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 72c69c0 + 6a96efe commit 2d02299Copy full SHA for 2d02299
variable_type.py
@@ -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