While working with FragIt I had to figure out whether two lists had some elements in common (it does not matter which!) and I came up with the following piece of code (with the help of Google and Stack Overflow of course)
It takes advantage of the highly underused Sets available in python on which we can do some neat mathematically sane operations. I guess people just go for Lists and work their magic on that.
And just to get fancy:
ReplyDeleteshares_elements=lambda a,b: len(set(a)&set(b))>0
I love lambda expressions ^_^
Thats very clever actually! :) thanks for sharing
DeleteHeritage Cabs offers service like Jaipur Car rentalJaipur car hire, taxi hire jaipur car rental service in jaipur @ Rs 8/Km
ReplyDeleteGym nearby Gopalpura by Incarnation The Health Club we provide Gym service in Gopalpura bypass (Jaipur), best gym service nearby Gopalpura & Gym service near gopalpura bypass
ReplyDeleteDigital Markeing Company In Jaipur
ReplyDeleteDigitalopeners is the best Digital marketing company in jaipur provide Digital Marketing Service in Jaipur and other web services. SEO, SMO, SMM, PPC, Email Marketing, Digital Marketing Service in Jaipur.
Tempo Traveller Rental in Jaipur
ReplyDeleteTempo Traveller Rental Jaipur, Tempo Traveller Hire Jaipur for outstation & sightseeing Purpose, Book Tempo traveller Rental jaipur, Tempo traveller in Jaipur