replace bitwise xor with !=
This commit is contained in:
parent
82f06fae28
commit
f34d791b85
|
@ -30,7 +30,7 @@
|
||||||
"def primitive_pythagorean_triplets():\n",
|
"def primitive_pythagorean_triplets():\n",
|
||||||
" for m in count(2):\n",
|
" for m in count(2):\n",
|
||||||
" for n in range(1, m):\n",
|
" for n in range(1, m):\n",
|
||||||
" if not ((m % 2) ^^ (n % 2)) or gcd(m, n) != 1:\n",
|
" if not ((m % 2) != (n % 2)) or gcd(m, n) != 1:\n",
|
||||||
" continue\n",
|
" continue\n",
|
||||||
"\n",
|
"\n",
|
||||||
" a = m ** 2 - n ** 2\n",
|
" a = m ** 2 - n ** 2\n",
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
" break\n",
|
" break\n",
|
||||||
"\n",
|
"\n",
|
||||||
" for n in range(1, m):\n",
|
" for n in range(1, m):\n",
|
||||||
" if not ((m % 2) ^^ (n % 2)) or gcd(m, n) != 1:\n",
|
" if not ((m % 2) != (n % 2)) or gcd(m, n) != 1:\n",
|
||||||
" continue\n",
|
" continue\n",
|
||||||
" \n",
|
" \n",
|
||||||
" a = m^2 - n^2\n",
|
" a = m^2 - n^2\n",
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
" break\n",
|
" break\n",
|
||||||
"\n",
|
"\n",
|
||||||
" for n in range(1, m):\n",
|
" for n in range(1, m):\n",
|
||||||
" if not ((m % 2) ^^ (n % 2)) or gcd(m, n) != 1:\n",
|
" if not ((m % 2) != (n % 2)) or gcd(m, n) != 1:\n",
|
||||||
" continue\n",
|
" continue\n",
|
||||||
" \n",
|
" \n",
|
||||||
" a = m^2 - n^2\n",
|
" a = m^2 - n^2\n",
|
||||||
|
|
Loading…
Reference in New Issue