
def words_length(data: list):
    return [len(x) for x in data]


def filter_long_words(data: list, n: int):
    return [x for x in data if len(x) > n]


def is_member(value, lst: list):
    return value in lst


# Пересечение множеств
def overlapping(l1: list, l2: list):
    return bool(set(l1).intersection(l2))


def find_longest_word_len(lst: list):
    return max([len(x) for x in lst])


def register_check(dct: dict):
    return len([x for x in dct.values() if x == 'yes'])


# Объединение списков в список кортежей
def create_tuples(l1: list, l2: list):
    return list(zip(l1, l2))


def make_header(text: str, level: int):
    return f'<h{level}>{text}</h{level}>'


alpha = 'abcdefghijklmnopqrstuvwxyz'

def is_pangram(st: str):
    st_set = [x.lower() for x in st if x.isalpha()]
    return set(st_set) == set(alpha)
    # return bool(set(st.lower()).intersection(list(alpha)))
    # return bool(set(alpha).intersection(list(st.lower())))
    

def translate_to_robber_lang(st: str):
    foo = ['a','e', 'i', 'o', 'u', 'A','E', 'I', 'O', 'U']
    crypted_string = ''
    for i in st:
        if i.isalpha() and i not in foo:
            crypted_string += f'{i}o{i}'
        else:
            crypted_string += i
    return crypted_string




tables = {
    1: {'name': 'Andrey', 'is_vip': True},
    2: None,
    3: None,
    4: None,
    5: {'name': 'Vasiliy', 'is_vip': False},
    6: None,
    7: None,
    8: None,
    9: None,
}


def is_table_free(table_number: int):
    return tables[table_number] is None

def get_free_tables():
    return [x[0] for x in tables.items() if x[1] is None]

def reserve_table(table_number: int, name: str, status: bool):
    if is_table_free(table_number):
        tables[table_number] = {'name': name, 'is_vip': status}
        
def delete_reservation(table_number):
    tables[table_number] = None


def main():
    # print(words_length(['Python', 'is', 'awesome!'])) 
    # print(filter_long_words(['Python', 'stole', 'my', 'heart'], 4))
    # print(overlapping(['this', 'might', 'work'], ['or', 'maybe', 'this']))
    # print(find_longest_word_len(['default', 'ghostwriter', 'bother', 'applaud', 'skate', 'way']))

    # people = {'Igor': 'yes', 'Stas': 'no', 'Peter': 'no', 'Mary': 'yes'}
    # print(register_check(people))

    # print(create_tuples([1, 2, 3, 4], [5, 6, 7, 8]))

    # print(make_header('Нет', 1))

    # print(is_pangram('The quick brown fox jumps over the lazy dog.'))

    # print(translate_to_robber_lang('I Think YoU Might BE righT!'))

    print(is_table_free(2))
    print(get_free_tables())

    print(tables)
    reserve_table(2, 'Ivan', True)
    print(tables)
    reserve_table(2, 'Anton', False)
    print(tables)
    delete_reservation(2)
    print(tables)

if __name__ == '__main__':
    main()
