I am trying to check a data type in python. I want to use an if statement to check if the data is a string or not. And everytime i input an integer it returns the value as a string.
Here is the code.
inp = input("Input: ")
if type(inp) != str:
print("You must input a string")
else:
print("Input is a string")
this is the message it returns.
Input is a string
I want it to print "You must input a string"