Goldbach's comet: Difference between revisions

Content added Content deleted
m (→‎{{header|J}}: further clarification)
(→‎{{header|Python}}: added the missing show())
Line 421: Line 421:


=={{header|Python}}==
=={{header|Python}}==
<lang python>from matplotlib.pyplot import scatter
<lang python>from matplotlib.pyplot import scatter, show
from sympy import isprime
from sympy import isprime


Line 445: Line 445:
colors = [["red", "blue", "green"][(i // 2) % 3] for i in x]
colors = [["red", "blue", "green"][(i // 2) % 3] for i in x]
scatter([i // 2 for i in x], y, marker='.', color = colors)
scatter([i // 2 for i in x], y, marker='.', color = colors)
</lang>{{out}}
show()</lang>{{out}}
<pre>
<pre>
The first 100 G numbers are:
The first 100 G numbers are: