Data type identification and printing

Report a typo

The code below defines various variables, determines and prints out the data type of each variable. Fill in the blanks for the code to work correctly. Keep in mind that you need a function, not a string with the name of the data type.

Fill in the gaps with the relevant elements
# Define a variable with a string value
data = "Hello, world!"
data_type = (data)
print("The data is a", data_type)

# Define a variable with an integer value
data = 42
data_type = (data)
print("The data is an", data_type)

# Define a variable with a float value
data = 3.14
data_type = (data)
print("The data is a", data_type)
___

Create a free account to access the full topic