I need help with a small assignment, I'm just starting out in Python... I want to create a data type identifier, wherein if I type an int, it will output "It is an int" and if I type a string it will output "It is a String", basically that...
So far this is my code:
input_data = (input())
data_calculator = (type(input_data))
if data_calculator == str:
print("It is a String")
elif data_calculator == float:
print("It is a float")
elif data_calculator == int:
print("It is an int")
else:
print("Error mate...")
I think the problem is when I type in the console, it treats the int and float as an str.
Current outputs:
when I type an Int or a float, it keeps outputting, "It is a String"
Any help is appreciated, thank you