Python allows a concept called "keyword arguments", where you tell it which parameter you're passing in the call to the function. However, the standard split()
function does not take this kind of parameter.
To split a string into a list of characters, use list()
:
>>> a = "hello"
>>> list(a)
['h', 'e', 'l', 'l', 'o']
As an aside, an example of keyword parameters might be:
def foo(bar, baz=0, quux=0):
print "bar=", bar
print "baz=", baz
print "quux=", quux
You can call this function in a few different ways:
foo(1, 2, 3)
foo(1, baz=2, quux=3)
foo(1, quux=3, baz=2)
Notice how you can change the order of keyword parameters.