Complete the function/method so that it takes CamelCase string and returns the string in snake_case notation. Lowercase characters can be numbers. If method gets number, it should return string.
Examples:
``` javascript
//  returns test_controller
toUnderscore('TestController');
// returns movies_and_books
toUnderscore('MoviesAndBooks');
// returns app7_test
toUnderscore('App7Test');
// returns "1"
toUnderscore(1);
```
``` coffeescript  
#  returns test_controller
toUnderscore 'TestController'
# returns movies_and_books
toUnderscore 'MoviesAndBooks'
# returns app7_test
toUnderscore 'App7Test'
# returns "1"
toUnderscore 1
```
def to_underscore(string):
    string = str(string)
    new = []
    for s in string:
        if not new:
            new.append(s)
        else:
            if s.isupper():
                new.append("_")
            new.append(s)
    return "".join(new).lower()

def to_underscore(string):
    string = str(string)
    new = []
    for s in string:
        if not new:
            new.append(s)
        else:
            if s.isupper():
                new.append("_")
            new.append(s)
    return "".join(new).lower()
