Пример #1
0
def console():

    hash_table = HashTable()

    while True:
        op = input(prompts['operations'])

        if op == '1':
            word = input(prompts['word'])
            hash_table.add(word)
            print(hash_table)
        elif op == '4':
            return
Пример #2
0
def test_repr():
    table = HashTable()
    assert (table)
    table.add('qwe')
Пример #3
0
def test_add():
    table = HashTable()
    assert ('qwe' not in table)
    table.add('qwe')
    assert ('qwe' in table)
Пример #4
0
def test_remove():
    table = HashTable()
    table.add('qwe')
    assert ('qwe' in table)
    table.remove('qwe')
    assert ('qwe' not in table)