homework_05/19_teodor_dishanski/decrypt.py
def decrypt_single_word(word, key, space_flag):
    """Decrypt a whole string with a given key."""
    assert isinstance(word, str)
    assert isinstance(key, int)
    assert isinstance(space_flag, bool)

    decrypted_word = ''

    assert isinstance(word, str)
    assert isinstance(key, int)
    assert isinstance(space_flag, bool)

    for char in word:
        condition_upper = (65 <= ord(char) <= 90)
        condition_lower = (97 <= ord(char) <= 122)

        if condition_upper or condition_lower:
            decrypted_word += decrypt_single_char(char, key)
        else:
            decrypted_word += char

    return decrypted_word + ' ' if space_flag else decrypted_word
Decrypt a whole string with a given key.
Decrypt a whole string with a given key.
Decrypt a whole string with a given key .
def decrypt_single_word(word, key, space_flag):
    assert isinstance(word, str)
    assert isinstance(key, int)
    assert isinstance(space_flag, bool)
    decrypted_word = ''
    assert isinstance(word, str)
    assert isinstance(key, int)
    assert isinstance(space_flag, bool)
    for char in word:
        condition_upper = (65 <= ord(char) <= 90)
        condition_lower = (97 <= ord(char) <= 122)
        if condition_upper or condition_lower:
            decrypted_word += decrypt_single_char(char, key)
        else:
            decrypted_word += char
    return decrypted_word + ' ' if space_flag else decrypted_word
def decrypt_single_word ( word , key , space_flag ) : assert isinstance ( word , str ) assert isinstance ( key , int ) assert isinstance ( space_flag , bool ) decrypted_word = '' assert isinstance ( word , str ) assert isinstance ( key , int ) assert isinstance ( space_flag , bool ) for char in word : condition_upper = ( 65 <= ord ( char ) <= 90 ) condition_lower = ( 97 <= ord ( char ) <= 122 ) if condition_upper or condition_lower : decrypted_word += decrypt_single_char ( char , key ) else : decrypted_word += char return decrypted_word + ' ' if space_flag else decrypted_word
Decrypt a whole string with a given key.
Decrypt a whole string with a given key .
"""Decrypt a whole string with a given key."""
word
key
space_flag