our_list = ["2121","eew3232", "32d-3", "(32"]new_lst = [item for item in our_list if item.isdigit()]print(new_lst)
Standard input is empty
['2121']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!