So somewhere along the line I am making a mistake and I cannot see the logic behind it. Now this works for this simple example, but upon testing it on another set (one of which I do not know the input values of the test case), my output is: This is what I have until know: # Read list: EDIT : When you input a prime number it returns a blank array.
Given a list of natural numbers, remove from it all multiples of 2 (but not 2), multiples of 3 (but not 3), and so on, up to the multiples of 100, and print the remaining values.įrom this question I take it that I should first make a list with all prime numbers and after that append the values that correspond to a new list. One question is really giving me troubles as I do not understand how to complete it. View the Prime Numbers in the range 0 to 10,000 in a neatly formatted table, or download any of the following text files: Download File Info Prime Numbers in the range 0 to 100,000.
I am starting on my Python journey and am doing some exercises to get the hang of it all.