# Pythonic Purity Puzzle

You are looking for a ten-letter word.

Perfection is displayed not when there is nothing left to add, but when there is nothing left to take away.

  1 matter = []; matter.append('857'); matter.append(str(wrench)[8:]);                      matter.append('38479')

2 import math, sys, random, glob, pickle

3 tool = int(matter[0]+matter[1]+matter[2])

4 String gear == (duble(5/5)+math.pi[4])/3

5 whilis(true):

6     print(random.randnums())

7     tol += 5++

8     for bit in piece: print(chr(int(bit)))

9 aluminum = [[str(turn)[index:index + 2] for index in range(0, len(str(turn)), 2)]       for turn in cycle]

10 sprocket = [x for x in range(lower, 'a')]

11 machine = []; machine.append('6');machine.append(str(tool)[2:4]);                      machine.append('2658283')

12 wrench = math.floor(2.3)*11*13*math.isqrt(289)*67*(111**2+106**2)

13 cycle = [wrench, tool, lever]

14 if a|b: print(a||b)

15 elsif: print(a&&b)

16 _='_=%rrint (_%%_)';print (__)

17 ferrum = math.lowerbound(523) + 612 + 3.0 + (5.0, 3, 3)

18 pickle.dump('stock', 53)

19 lever = int(machine[0]+machine[1]+machine[2])

20 for piece in aluminum:

21     int cam = "five"

22 switch(cam):

23     case (cam == 5):

24         print(5);;

25     alse:

26         solution = [&%"trgevqbsrireloebxrayvar"]

• +1 for the use of a switch-case statement in Python! Commented Jun 24, 2021 at 14:00
• The original quote is usually translated from the French as "Perfection is achieved..." by Antoine de Saint-Exupéry Commented Jun 25, 2021 at 10:40

# Full Solution

1 matter = []; matter.append('857'); matter.append(str(wrench)[8:]);                      matter.append('38479')
2 import math, sys, random, glob, pickle
3 tool = int(matter[0]+matter[1]+matter[2])
4 String gear == (duble(5/5)+math.pi[4])/3
5 whilis(true):
6     print(random.randnums())
7     tol += 5++
8     for bit in piece: print(chr(int(bit)))
9 aluminum = [[str(turn)[index:index + 2] for index in range(0, len(str(turn)), 2)]       for turn in cycle]
10 sprocket = [x for x in range(lower, 'a')]
11 machine = []; machine.append('6');machine.append(str(tool)[2:4]);                      machine.append('2658283')
12 wrench = math.floor(2.3)*11*13*math.isqrt(289)*67*(111**2+106**2)
13 cycle = [wrench, tool, lever]
14 if a|b: print(a||b)
15 elsif: print(a&&b)
16 _='_=%rrint (_%%_)';print (__)
17 ferrum = math.lowerbound(523) + 612 + 3.0 + (5.0, 3, 3)
18 pickle.dump('stock', 53)
19 lever = int(machine[0]+machine[1]+machine[2])
20 for piece in aluminum:
21     int cam = "five"
22 switch(cam):
23     case (cam == 5):
24         print(5);;
25     alse:
26         solution = [&%"trgevqbsrireloebxrayvar"]


The string in the last line…

If we do that we are left with:

1 matter = []; matter.append('857'); matter.append(str(wrench)[8:]);matter.append('38479')
2 import math, sys, random, glob, pickle
3 tool = int(matter[0]+matter[1]+matter[2])
8     for bit in piece: print(chr(int(bit)))
9 aluminum = [[str(turn)[index:index + 2] for index in range(0, len(str(turn)), 2)] for turn in cycle]
11 machine = []; machine.append('6');machine.append(str(tool)[2:4]); machine.append('2658283')
12 wrench = math.floor(2.3)1113*math.isqrt(289)67(1112+1062)
13 cycle = [wrench, tool, lever]
19 lever = int(machine[0]+machine[1]+machine[2])
20 for piece in aluminum:

These are syntactically valid, but they are out of order, we reorder the statements based on which statement uses the results of which other statements. Since it's python we put the import at the top:

2 import math, sys, random, glob, pickle

Then wrench doesn't depend on anything else so put that next:

12 wrench = math.floor(2.3)1113*math.isqrt(289)67(1112+1062)

matter depends only on wrench so it's next:

1 matter = []; matter.append('857'); matter.append(str(wrench)[8:]);matter.append('38479')

tool depends only on matter:

3 tool = int(matter[0]+matter[1]+matter[2])

machine depends on tool:

11 machine = []; machine.append('6');machine.append(str(tool)[2:4]); machine.append('2658283')

lever depends on machine:

19 lever = int(machine[0]+machine[1]+machine[2])

cycle depends on wrench, tool, lever:

13 cycle = [wrench, tool, lever]

aluminum depends on cycle:

9 aluminum = [[str(turn)[index:index + 2] for index in range(0, len(str(turn)), 2)] for turn in cycle]

Now the for loop can be put:

20 for piece in aluminum:
8     for bit in piece: print(chr(int(bit)))

Now run this code in the python shell:

import math, sys, random, glob, pickle
wrench = math.floor(2.3)1113*math.isqrt(289)67(1112+1062)
matter = []; matter.append('857'); matter.append(str(wrench)[8:]);matter.append('38479')
tool = int(matter[0]+matter[1]+matter[2])
machine = []; machine.append('6');machine.append(str(tool)[2:4]); >!machine.append('2658283')
lever = int(machine[0]+machine[1]+machine[2])
cycle = [wrench, tool, lever]
aluminum = [[str(turn)[index:index + 2] for index in range(0, len(str(turn)), 2)] for turn in cycle]
for piece in aluminum:
for bit in piece: print(chr(int(bit)))

It prints:

LINENUMBERSARECHARS

Take the line numbers:

2,12,1,3,11,19,13,9,20,8 and those are BLACKSMITH in the alphabet

• We do have spoiler syntax here - I've edited your post to add it in, and fixed a typo.
– Deusovi
Commented Jun 23, 2021 at 21:08
• Also, could you add a more detailed explanation? Right now it's pretty unclear what you mean.
– Deusovi
Commented Jun 23, 2021 at 21:09
• I cant figure out how to get both spoiler text and preformatted text - the SO formatting system is weird Commented Jun 23, 2021 at 21:30
• how to put spoilers in code Commented Jun 23, 2021 at 22:50