count = 0
while count < 100:
count +=1
if count/2 = 0:
print (‘this is 2’)
print (count)
count = 0
while count < 100:
count +=1
if count/2 = 0:
print (‘this is 2’)
print (count)
The desired output from your code is not clear… however, if you are using loops like while or if, you need to indent your blocks. Additionally, you use the == operator to evaluate equality, = simply assigns values to variables. I think you intended to use % instead of / in if count/2 = 0 . Below are my suggestions:
count = 0
while count < 100:
count +=1
if count % 2 == 0:
print (count, ‘this is divisible by 2’)
print (count)
This post was flagged by the community and is temporarily hidden.
Thank you! is it possible to make it so that it also removes the original number?