Write a function taking in a string like `WOW this is REALLY          amazing` and returning `Wow this is really amazing`. String should be capitalized and properly spaced. Using `re` and `string` is not allowed.

Examples:

```python
filter_words('HELLO CAN YOU HEAR ME') #=> Hello can you hear me
filter_words('now THIS is REALLY interesting') #=> Now this is really interesting
filter_words('THAT was EXTRAORDINARY!') #=> That was extraordinary!
```

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def filter_words(st):
	

Solutions:
def filter_words(st):
	return ' '.join(st.capitalize().split())


def filter_words(st):
	st1 = st.lower()
	st2 = st1.capitalize()
	st3 = ' '.join(st2.split())
	return st3


def filter_words(s):
	return ' '.join(s.split()).capitalize()


def filter_words(stg):
	return ' '.join(stg.split()).capitalize()


def filter_words(strng):
	return ' '.join(strng.split()).capitalize()


def filter_words(st):
	s = st.lower()
	t = s.capitalize()
	a = ' '.join(t.split())
	return a


def filter_words(string):
	correct_string = string[0].capitalize() + string[1:].lower()
	return ' '.join(correct_string.split())


def filter_words(st):
	st2 = st[0] + st.lower()[1:]
	return ' '.join(st2.capitalize().split())