Created
October 30, 2014 06:54
-
-
Save alexandre/42866078f09a112ea92e to your computer and use it in GitHub Desktop.
math and python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Demonstrate how to use Python’s list comprehension syntax to produce | |
| the list [0, 2, 6, 12, 20, 30, 42, 56, 72, 90]. | |
| cp = current position | |
| list[cp + 1](2) - cp(0) == 2 | |
| list[cp +1](6) - cp(2) == 4 | |
| list[cp +1](12) - cp(6) == 6 | |
| list[cp +1](20) - cp(12) == 8 | |
| list[cp + 1](30)- cp(20) == 10 | |
| "Second-order arithmetic" | |
| ... | |
| not solved yet... | |
| ''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[(x + 1) * x for x in range(10)]