I have a randomly generated list of which contains letters, symbols, and numbers and need to separate it into 2 lists -one of numbers and one of the remaining chars. Then I need to separate the numbers into 2 lists-one of composite numbers (4,6,8,9) and one a list of prime numbers(2,3,5,7). I can make a list of the numbers, but it doesn't separate it from the list:
>>>s="1#%$^5hbg458#$54bjyfuig324ghal&%90a11y$#6ty7" >>>sdigits=''.join([letter for letter in s if letter.isdigit()]) >>>sdigits '1545854324901167'
but if I then 'print s' the numbers are still in it. Any ideas?