Ad
Code
Diff
  • def is_prime(n):
        return n == 2 or n > 1 and all(n % i for i in range(3, int(n**0.5)+1, 2))
    • def is_prime(n):
    • return n > 1 and all(n % i for i in range(2, int(n**0.5)+1))
    • return n == 2 or n > 1 and all(n % i for i in range(3, int(n**0.5)+1, 2))
Code
Diff
  • def distance_count(x, y):
        return sum((xi-yi)**2 for xi, yi in zip(x, y))**0.5
    
    • def distance_count(a,b):
    • return sum([(i-j)**2 for (i,j) in zip(a,b)])**0.5
    • def distance_count(x, y):
    • return sum((xi-yi)**2 for xi, yi in zip(x, y))**0.5