That’s a fair question. The short and simple answer is that what I stated is a rule of thumb. It’s right in most cases, but it’s not always. I have a more complicated summing up, but it’s not as easy to understand. Here it is:
Functions using dot notation are attached to a specific object and will only work on that object. Multiple objects can have a function that does the same thing (e.g., all strings have a .upper() function), but if you tried to use .upper() on a non-string, it would tell you that the function doesn’t even exist. This is because the .upper() function has not been assigned to non-strings. You could assign a .upper() function to it, but it is not built in (and it wouldn’t do the same thing).
Functions without dot notation are general functions that can usually be passed any object. For example, the len() function can be used on strings, arrays, lists, dictionaries, etc. and will still work fine. It is not restricted to one data type.
So, is my “rule” true? No. But it’s usually the case. In most cases that a function is only assigned to one data type (dot notation), it’s because you’re altering the data in a way that wouldn’t make sense in other data types. Most of the time that you use a method, it’s because you’re getting information that exists in many different data types.
But there are exceptions. There is information about a string that would make sense about an integer, and there are things you can do to a string that you can also do to an integer.
Let’s test my more complicated rule on your examples:
.isalpha() would not make sense in any context but a string (why would you ask an integer or array if it is made of letters of the alphabet?) so it uses dot notation
.isdigit() would not make sense in any context but a string (an integer or float will always be made of digits, and others will not be) so it uses dot notation
input() works on most data types, so it should be a method.
print() works on most data types, so it should be a method.
I’m not going to argue your len() example since, as you stated, that’s not a usual use. I’m not sure what’s going on there. (Maybe the double underscores signify that you’re calling a method? I really have no idea. Might make a good google search)
.split() and .join() don’t make sense in any context but strings, so they use dot notation (they might make sense in the context of arrays, lists, etc., but they would go about it in completely different ways, so you couldn’t use the same method)
I hope that clears things up a bit. Maybe I should have stated that there are exceptions in my first message, but I think it’s simpler for people to see at first a rule of thumb. If they’re interested, I guess they can now read on to this.
(Just a warning: my python’s a bit rusty. I might have accidentally said something from JS. Please forgive me. They’re not extremely different, so hopefully, the idea I’m trying to get across will still make sense if that happens)