We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8322d13 commit d356bd7Copy full SHA for d356bd7
Numbers/binary_decimal.py
@@ -27,8 +27,7 @@ def decimal_to_binary(decimal):
27
remainders.append(str(decimal % 2))
28
decimal /= 2
29
remainders.reverse()
30
- binary = "".join(remainders)
31
- return binary
+ return "".join(remainders)
32
33
if __name__ == '__main__':
34
print """
Numbers/prime.py
@@ -5,10 +5,7 @@
5
import math
6
7
def is_a_prime(x):
8
- for i in range(2, x):
9
- if x % i == 0:
10
- return False
11
- return True
+ return all(x % i != 0 for i in range(2, x))
12
13
# standard boilerplate
14
0 commit comments