Check if a dictionary is subset of another dictionary

Viewed 558

I am trying to compare 2 Strings and check if all characters in String a are present in String b. I am currently using the following method by converting the string into a dictionary and comparing it with the other. But there are many chances that it gives a false positive.

x = 'NJITZU THE HANDS OF TIME'
y = 'NinjaGo Masters of Spinjitzu The Hands of Time'
if Counter(x) < Counter(y):
    print 'Yes'
else:
    print 'No'

Please suggest any better way to do this

3 Answers
Related