This is suposed to check if a number is even or odd by dividing it by 2 but it is always looking at the same number
a= [1,2,5,7,8];
i=0
c=a[i]/2.0;
d=0;
b=len(a);
while i < b:
if (c).is_integer():
i=i+1;
d=d +1;
else:
i=i +1;
print(d);
The answer given to me is 0 but if the first number on the list even the answer given is 5.
Apparently it is always detecting the number a not integer, so is there any way to check if the number has or not decimals?