Hello,
Trying to substract one index by another.
Any pointers?
TY
Trying to substract one index by another.
def is_prime_v1(n): """Return a boolean indicating if integer n is prime""" if n == 1: return False for d in range(2, n): if n % d == 0: return False return n prime = [] for n in range(1,20): if is_prime_v1(n): print(is_prime_v1(n)) prime.append(n) for idx, pr in enumerate(prime): print((pr[idx]+1) - pr[idx])Of course you cannot do that. There is probably a way. I have been searching on the net but its always the same examples that are coming back.
Any pointers?
TY