You should write a function that takes a string and a positive integer `n`, splits the string into parts of length `n` and returns them in an array. It is ok for the last element to have less than `n` characters.

If `n` is not a valid size (`> 0`) (or is absent), you should return an empty array.

If `n` is greater than the length of the string, you should return an array with the only element being the same string.

Examples:

```python
string_chunk('codewars', 2) # ['co', 'de', 'wa', 'rs']
string_chunk('thiskataeasy', 4) # ['this', 'kata', 'easy']
string_chunk('hello world', 3) # ['hel', 'lo ', 'wor', 'ld']
string_chunk('sunny day', 0) # []
```

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def string_chunk(string, n=0):
	

Solutions:
def string_chunk(string, n=0):
	return [string[i:i + n] for i in range(0, len(string), n)] if isinstance(n, int) and n > 0 else []


def string_chunk(s, n=0):
	if not isinstance(n, int) or n == 0:
		return []
	return [s[i:i + n] for i in range(0, len(s), n)]


def string_chunk(string, n=None):
	ret = []
	if isinstance(n, int) and n > 0:
		for i in range(0, len(string), n):
			ret.append(string[i:i + n])
	return ret


def string_chunk(xs, n=None):
	try:
		return [xs[i:i + n] for i in range(0, len(xs), n)]
	except:
		return []


def string_chunk(string, n=0):
	try:
		return [string[a:a + n] for a in range(0, len(string), n)]
	except (TypeError, ValueError):
		return []