So I was given a list and I must print the type of each item in the list. I can clearly see that there are strings and integers but I need it to print out in Python. We just
a=[12,"string"]
for i in a: #sets the value of a to be any item in list (a)
print(type(a), end=" ")
OUTPUT:
>>>
In the python code above type() function is used to determine the data type of variable (i). And end() is used to replace the end of the output with the value inside its' brackets () instead of a new line as you must have observed in the above output that between the 2 outputs "____ " (space) was placed without a new line.