First commit of partial RosettaCode contents.
Pushing this for testing purposes. Lots of work still needed.
This commit is contained in:
commit
1e05ecd7ee
781 changed files with 9080 additions and 0 deletions
8
Task/Ordered_words/Python/ordered_words.py
Normal file
8
Task/Ordered_words/Python/ordered_words.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import urllib.request
|
||||
|
||||
url = 'http://www.puzzlers.org/pub/wordlists/unixdict.txt'
|
||||
words = urllib.request.urlopen(url).read().decode("utf-8").split()
|
||||
ordered = [word for word in words if word==''.join(sorted(word))]
|
||||
maxlen = len(max(ordered, key=len))
|
||||
maxorderedwords = [word for word in ordered if len(word) == maxlen]
|
||||
print(' '.join(maxorderedwords))
|
||||
Loading…
Add table
Add a link
Reference in a new issue