PyPy also manages to speed this program up (or at least, what I understand this program to be):
Alexanders-MacBook-Pro:tmp alex_gaynor$ time python t.py
.
real 0m0.202s
user 0m0.194s
sys 0m0.007s
Alexanders-MacBook-Pro:tmp alex_gaynor$ time python t.py
.
real 0m0.192s
user 0m0.184s
sys 0m0.008s
Alexanders-MacBook-Pro:tmp alex_gaynor$ time python t.py
.
real 0m0.198s
user 0m0.190s
sys 0m0.007s
Alexanders-MacBook-Pro:tmp alex_gaynor$ time pypy t.py
.
real 0m0.083s
user 0m0.068s
sys 0m0.013s
Alexanders-MacBook-Pro:tmp alex_gaynor$ time pypy t.py
.
real 0m0.083s
user 0m0.068s
sys 0m0.013s
Alexanders-MacBook-Pro:tmp alex_gaynor$ time pypy t.py
.
real 0m0.082s
user 0m0.067s
sys 0m0.013s
Alexanders-MacBook-Pro:tmp alex_gaynor$ cat t.py
def main():
vals = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o"}
for v in vals:
for w in vals:
for x in vals:
for y in vals:
for z in vals:
if v + w + x + y + z == "abcde":
print(".")
main()