new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
8
Task/Ordered-words/Python/ordered-words-1.py
Normal file
8
Task/Ordered-words/Python/ordered-words-1.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