Solution :
We have to provide an expression for the binary numbers. There can be binary fractions or integers. Whenever there is leading 0, it is not allowed unless the integer part is a 0.
Thus the expression is :
It is a power-saving mode for a computer.
It is a power-saving mode designed for laptops.
Answer:
from collections import Counter
def anagram(dictionary, query):
newList =[]
for element in dictionary:
for item in query:
word = 0
count = 0
for i in [x for x in item]:
if i in element:
count += 1
if count == len(item):
newList.append(item)
ans = list()
for point in Counter(newList).items():
ans.append(point)
print(ans)
mylist = ['jack', 'run', 'contain', 'reserve','hack','mack', 'cantoneese', 'nurse']
setter = ['ack', 'nur', 'can', 'con', 'reeve', 'serve']
anagram(mylist, setter)
Explanation:
The Counter class is used to create a dictionary that counts the number of anagrams in the created list 'newList' and then the counter is looped through to append the items (tuple of key and value pairs) to the 'ans' list which is printed as output.
Answer:
yh3iuskjldnsjfhbcgfihekwfhei3wh8hfefbgp
Explanation: