number=26
for n in range(101):
if n is number:
print(n, "This is the magic number")
break
else:
print(n)
The above code runs perfectly, but when I change the variable and the range, as below, it does not work properly.
number=260
for n in range(300):
if n is number:
print(n, "This is the magic number")
break
else:
print(n)