For example, I put this:
for i in range (2,n**0.5+1,2):
print(i)
And it doesn't work. I tried putting 1/2 instead but it didn't work I have python 3.6
For example, I put this:
for i in range (2,n**0.5+1,2):
print(i)
And it doesn't work. I tried putting 1/2 instead but it didn't work I have python 3.6
Unfortunately, range
only accepts integers. But you can use this function instead:
def frange(start, stop, step):
current = start
while current < stop:
yield current
current += step