Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """T04."""
- def make_hola_string(count: int) -> str:
- """
- Make hola string.
- :param: number of holas
- :return:
- """
- return count * 'hola'
- def alphabet_index(letters, letter: str):
- """
- Find index.
- :param letters: list, str
- :param letter: str
- :return: int
- """
- out = 'Letter not found.'
- for i, val in enumerate(letters):
- if val == letter:
- out = i
- break
- return out
- def multiply_letter(letter: str, times: int) -> str:
- """
- Multiplying letters
- :param times: int
- :param letter: str
- :return: str
- """
- for x in letter:
- if letter == x:
- return x *times
- def decrypt_cipher(ciphertext: str, key: int) -> str:
- """
- Decrypt and you shall find.
- :param ciphertext: str
- :param key: int
- :return:
- """
- return ''.join((ciphertext[i] for i in range(0, len(ciphertext),key)))
- def find_mode(string: str) -> str:
- """
- Find mode.
- :param string: str
- :return: mode
- """
- return max(string, key=string.count) if string else ''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement