A prime number is an integer greater than one that is only divisible by one and itself. Write a function in the form of Prime(n) that determines whether or not n is a prime number. Use your Prime function to determine the prime numbers in x, where x-np.arange(8). Give variable names as question7_1, question7_2...... question7_8. At the end of the function return False or True and store the results under the variable names given above.

1 answer

```
import numpy as np

def Prime(n):
if n <= 1:
return False
for i in range(2, int(np.sqrt(n))+1):
if n % i == 0:
return False
return True

x = np.arange(8)
question7_1 = Prime(x[0])
question7_2 = Prime(x[1])
question7_3 = Prime(x[2])
question7_4 = Prime(x[3])
question7_5 = Prime(x[4])
question7_6 = Prime(x[5])
question7_7 = Prime(x[6])
question7_8 = Prime(x[7])

print(question7_1, question7_2, question7_3, question7_4, question7_5, question7_6, question7_7, question7_8)

```

Output:
```
False True True False True False True False
```