Keywords
Authorizations, license
-
Visible by: Everyone -
All rights reserved
- Photo replaced on 28 Mar 2014
-
1 240 visits
Again: What I tell you three times is true!


Let's prove that The Hunting of the Snark is Nonsense:
-----------------------------------------------------------------------------------------------------
#! /usr/bin/python
statementList = [\
"I'm very much afraid I didn't mean anything but nonsense!",
"Just the place for a Snark!",
"Just the place for a Snark!",
"6 * 7 = 42",
"I'm very much afraid I didn't mean anything but nonsense!",
"6 * 7 = 39",
"6 * 7 = 39",
"Just the place for a Snark!",
"6 * 7 = 42",
"I'm very much afraid I didn't mean anything but nonsense!",
"6 * 7 = 39",
]
for s in (s for s in frozenset(statementList) if statementList.count(s) >= 3):\
print('"' + s + '" is true!')
-----------------------------------------------------------------------------------------------------
Yuck! Ipernity doesn't allow indentation as required by Python. But the code shown above works. It yields the same results as produced by the more "pythonic" code shown in the screenshot:
-----------------------------------------------------------------------------------------------------
"I'm very much afraid I didn't mean anything but nonsense!" is true!
"6 * 7 = 39" is true!
"Just the place for a Snark!" is true!
-----------------------------------------------------------------------------------------------------
(Background image based on "Green on Green" by MJ Maccardini (trailerfullofpix)
2012-02-26, www.ipernity.com/doc/goetzkluge/30126975)
-----------------------------------------------------------------------------------------------------
#! /usr/bin/python
statementList = [\
"I'm very much afraid I didn't mean anything but nonsense!",
"Just the place for a Snark!",
"Just the place for a Snark!",
"6 * 7 = 42",
"I'm very much afraid I didn't mean anything but nonsense!",
"6 * 7 = 39",
"6 * 7 = 39",
"Just the place for a Snark!",
"6 * 7 = 42",
"I'm very much afraid I didn't mean anything but nonsense!",
"6 * 7 = 39",
]
for s in (s for s in frozenset(statementList) if statementList.count(s) >= 3):\
print('"' + s + '" is true!')
-----------------------------------------------------------------------------------------------------
Yuck! Ipernity doesn't allow indentation as required by Python. But the code shown above works. It yields the same results as produced by the more "pythonic" code shown in the screenshot:
-----------------------------------------------------------------------------------------------------
"I'm very much afraid I didn't mean anything but nonsense!" is true!
"6 * 7 = 39" is true!
"Just the place for a Snark!" is true!
-----------------------------------------------------------------------------------------------------
(Background image based on "Green on Green" by MJ Maccardini (trailerfullofpix)
2012-02-26, www.ipernity.com/doc/goetzkluge/30126975)
- Keyboard shortcuts:
Jump to top
RSS feed- Latest comments - Subscribe to the comment feeds of this photo
- ipernity © 2007-2025
- Help & Contact
|
Club news
|
About ipernity
|
History |
ipernity Club & Prices |
Guide of good conduct
Donate | Group guidelines | Privacy policy | Terms of use | Statutes | In memoria -
Facebook
Twitter
Lua: