async def read_items(q: str = Query(..., min_length=3)):
pass
async def read_items(q: str = Query(min_length=3)):
pass
async def read_items(q: str):
pass
all = ["Вася", "Петя", "Ваня", "Света"]
cur = ["Вася", "Петя", "Леша", "Валя", "Коля"]
all_count = {n: all.count(n) for n in all}
cur_count = {n: cur.count(n) for n in cur}
missing = []
extra = []
for n in set(all + cur):
nac = all_count.get(n, 0)
ncc = cur_count.get(n, 0)
if nac > ncc:
missing.extend([n] * (nac - ncc))
elif nac < ncc:
extra.extend([n] * (ncc - nac))
if not extra:
print("Новых нет")
else:
print("Новых {}ч. - {}".format(len(extra), ", ".join(extra)))
if not missing:
print("Отсутствующих нет")
else:
print("Отсутствуют {}ч. - {}".format(len(missing), ", ".join(missing)))
исходя из того что значения уникальны
if "Вася" in student and "Петя" in student and "Ваня" in student and "Света" in student:
В целом спасибо, я понял.