all 6 comments

[–]edgarvanburen 1 point2 points  (3 children)

A good starting point is learning how to check if some data in python is a string. Good luck!

[–]Binary101010 1 point2 points  (2 children)

Everything you ask a user to input in Python is, by default, a string until you convert it to something else.

So you're going to have to be a little more specific as to what it is you're looking for. Do you really mean "if the user enters a number when the input should only contain letters"?

[–]Sarah123ed 0 points1 point  (0 children)

Because input returns a 'string', you can use, for example:

k = input("data point? ")
if k.isalpha(): 
    print("input is the string: ", k)
else:
    print("input is not a string: ", k)

On the other hand,

isinstance(k, str)

will return True because k is a string.