How to tell if item in list contains certain characters
<p>I have a script that creates a list of numbers, and i want to remove all numbers from the list that are not whole numbers (i.e have anything other than zero after the decimal point) however python creates lists where even whole numbers get .0 put on the end, and as a result i cant tell them apart from numbers with anything else. I can't use the int() function as it would apply to all of them and make them all integers, and then i'd lose the ones that originally were.</p>

<p>Here is my code:</p>

<pre><code>z = 300
mylist = []

while(z &gt; 1):
    z = z - 1
    x = 600851475143 / z
    mylist.append(x)

print(mylist)

[y for y in mylist if y #insert rule to tell if it contains .0 here]
</code></pre>

<p>the first bit just divides 600851475143 by every number between 300 and 1 in turn. I then need to filter this list to get only the ones that are whole numbers. I have a filter in place, but where the comment is i need a rule that will tell if the particular value in the list has .0</p>

<p>Any way this can be achieved?</p>
