x = ['USDGBP.q', 'CADUSD.q', 'GBPCAD.q']print([s for s in x if 'USD' in s and 'GBP' in s])
Standard input is empty
['USDGBP.q']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!