So I'm trying to create a function using for loops and splicing that prints out a word like this:

```
w
wo
wor
word
word
wor
wo
w

```

I am trying to learn about defining functions, so I want to use a function that allows both forward and reverse directions can be input. If I use the "return" function, my code terminates early. If I don't use the return function I get a "none". How can I get rid of the none?

Thanks

```
word = raw_input('Enter word to be spelled: ')
wordlength = len(word)
def direction(x):
    """Type direction of word to be spelled as str, forward or reverse."""

    if x == 'reverse':
        for x in range(wordlength, 0, -1):
            print word[:x]

    if x == 'forward':
        for x in range(0, wordlength + 1):
            print word[:x]           

print direction('forward')
print direction('reverse')

```