Hi my friends!
Here is a wrong code, Wrong and I don't know why.
My purpose is to make a sieve of Erasthotene.
I make an unique function with many inner loops.
But the execution don't go cross the lines
I illustrate this with the help of printing the different steps of the script.
If someone can poiint out some error or lack of understanding, he is welcome an I am grateful!
HERE IS THE CODE:
from math import sqrt
def holeofStrainer():
bigList = [False, False] + [True]*100
print("line 4 - bigList : ", bigList)
for num in range(2, 101):
print("line 6 - num : ", num)
for x in range(bigList[2], bigList[int(sqrt(num)) + 1]):
print("line 8 x : %d"%x)
if num % x == 0:
print("line 10 {0} divise par {1} = {2} ".format(num, x, num/x))
bigList[num] == False
print "bigList[{0} == {1}]".format(num, bigList[num])
bigList[num] == True
for multiple in range (2, int(101/num) + 1):
bigList[multiple] = False
return(bigList)
print("the last result of bigList {} ".format(holeofStrainer()))