RosettaCodeData/Task/Ordered-words/Python/ordered-words-2.py
Ingy döt Net 86c034bb8b new files
2013-04-10 12:38:42 -07:00

11 lines
351 B
Python

import urllib.request
mx, url = 0, 'http://www.puzzlers.org/pub/wordlists/unixdict.txt'
for word in urllib.request.urlopen(url).read().decode("utf-8").split():
lenword = len(word)
if lenword >= mx and word==''.join(sorted(word)):
if lenword > mx:
words, mx = [], lenword
words.append(word)
print(' '.join(words))