Kernighans large earthquake problem: Difference between revisions
Kernighans large earthquake problem (view source)
Revision as of 16:08, 22 September 2018
, 5 years ago→{{header|Python}}
Line 347:
<lang python>from os.path import expanduser
from functools import (reduce)
Line 367 ⟶ 366:
# GENERIC ABSTRACTIONS ----------------------------
# words :: String -> [String]▼
def words(s):▼
return re.split('\s+', s)▼
Line 388 ⟶ 383:
def readFile(fp):
return open(expanduser(fp)).read()
▲# words :: String -> [String]
▲def words(s):
|