In [6]:
def print_variable_info(val):
    print(type(val))
    print(val)
    print()
In [17]:
# string variable
string_val = "Hello World"
print_variable_info(string_val)

# integer variable
int_val = 20
print_variable_info(int_val)

# float number variable
float_val = 20.5
print_variable_info(float_val)

# complex number variable
complex_val = 1j
print_variable_info(complex_val)

# list variable
fruit_list = ["Apple", "Banana", "Cherry"]
print_variable_info(fruit_list)

# tuple variable
fruit_tuple = ("Apple", "Banana", "Cherry")
print_variable_info(fruit_tuple)

# range variable
range_val = range(6)
print_variable_info(range_val)

# dictionary variable
person_dict = {"name": "John", "age": 36}
print_variable_info(person_dict)

# set variable
fruit_set = {"Apple", "Banana", "Cherry"}
print_variable_info(fruit_set)

# frozen set variable
fruit_frozenset = frozenset({"apple", "banana", "cherry"})
print_variable_info(fruit_frozenset)

# boolean variable
boolean_val = True
print_variable_info(boolean_val)

# bytes variable
bytes_val = b"Hello"
print_variable_info(bytes_val)

# byte array variable
bytearray_val = bytearray(5)
print_variable_info(bytearray_val)

# memory view variable
memoryview_val = memoryview(bytes(5))
print_variable_info(memoryview_val)
<class 'str'>
Hello World

<class 'int'>
20

<class 'float'>
20.5

<class 'complex'>
1j

<class 'list'>
['Apple', 'Banana', 'Cherry']

<class 'tuple'>
('Apple', 'Banana', 'Cherry')

<class 'range'>
range(0, 6)

<class 'dict'>
{'name': 'John', 'age': 36}

<class 'set'>
{'Apple', 'Banana', 'Cherry'}

<class 'frozenset'>
frozenset({'apple', 'cherry', 'banana'})

<class 'bool'>
True

<class 'bytes'>
b'Hello'

<class 'bytearray'>
bytearray(b'\x00\x00\x00\x00\x00')

<class 'memoryview'>
<memory at 0x7fd8c87c6dc8>

In [ ]: