I think it is B because the + sign is saying that there is more than just guitars
Hope this is helpful :D
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:
A=input("Enter Number of Marks:")
b=[]
sum=0
i=0
for i in range(0,int(A)):
b.append(input("Enter Marks"))
sum+=int(b[i])
percentage1= (sum/int(A))*100
if percentage1>=20:
print("Grade A")
elif percentage1<=30 & percentage1>=20:
print("Grade B")
else:
print("Grade C")
Explanation:
The above program is in Python. And we are using here a dynamic list. And we are storing A marks in it. And then we are finding its average, and finally assigning the Grade as mentioned.