The following theme was posted to the laboratory OB group of Facebook's technical college era.
"Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics."If you count the number of characters in each word in the sentence, it is the pi.
Since JavaScript and Ruby have already been registered, I tried my best with Python. It wasn't the size that I could put on Twitter, so I'll write it on Qiita.
There is no need to explain, so one liner.
$ python -c "import re; print map(len, re.compile('[a-z]+', re.I).findall('Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.'));"
python --version
Python 2.7.8
Recommended Posts