I’m looking for the Python way to take a string and pass it to a function as a list, like so:
word = 'abc'
result = crazyfunction(cast(word,[]))
so that crazyfunction will receive a list like this:
word[0] = 'abc'
instead of a string.
The goal is to cast in the function parameter, instead of having to do an assignment before each call.
From your example, it looks like it would be as simple as building a list. Just call the function like this:
crazyfunction(['abc'])EDIT: Just tested it in the console: