I am trying to ask the user for a string only but whenever the user types an integer or a float, it does not execute the except ValueError code.
Here is my code:
word = input('Enter a string.')
try:
word1 = str(word)
print(word1)
print(type(word1))
except ValueError:
print('The value you entered is not a string.')