One way to do this is to use a function to check if numbers are prime, and then iterate through numbers until you have collected the first 88 prime numbers. Here is an example:
main.py280 chars17 lines
The is_prime()
function checks if a number is prime using a basic trial division method. The loop then iterates through numbers starting at 2 until the first 88 prime numbers are collected. The resulting array is printed at the end.
gistlibby LogSnag