Create a function `longer` that accepts a string and sorts the words in it based on their respective lengths in an ascending order. If there are two words of the same lengths, sort them alphabetically. Look at the examples below for more details.

```python
longer("Another Green World") => Green World Another
longer("Darkness on the edge of Town") => of on the Town edge Darkness
longer("Have you ever Seen the Rain") => the you Have Rain Seen ever
```

Assume that only only Alphabets will be entered as the input.
Uppercase characters have priority over lowercase characters. That is,
```python
longer("hello Hello") => Hello hello
```

Don't forget to rate this kata and leave your feedback!! 
Thanks

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def longer(s):
	

Solutions:
def longer(s):
	return ' '.join(sorted(s.split(), key=lambda w: (len(w), w)))


def longer(s):
	return ' '.join(sorted(s.split(' '), key=lambda x: (len(x), x)))


def longer(s):
	return ' '.join(sorted(s.split(), key=lambda item: (len(item), item)))


def longer(strng):

	def length_string(s):
		return len(s)
	initial_list = sorted(strng.split())
	result = ' '.join(sorted(initial_list, key=length_string))
	return result


def longer(s):
	return ' '.join(sorted(sorted(s.split(' ')), key=len))


longer = lambda s: ' '.join(sorted(s.split(' '), key=lambda x: (len(x), x)))


def longer(sentence):

	def conditional(word):
		return (len(word), word)
	words = sentence.split(' ')
	words = sorted(words, key=conditional)
	return ' '.join(words)