У меня задание: экстрактить строку, как я понял надо убрать пробелы между ними и поставить запятую, как это сделать?
def extract_information(line: str) -> list:
"""
Extract information from each line (without spaces or extra tabulation symbols).
Example output: ['Helen-elizabeth', 'IN PANIC', 'Ancient Ruins', None]
Example output: ['Julianne', 'EATEN', 'Heaven', 'Will rule the kingdom'].
Obviously, she won't rule anything, however. How sad.
:param line: decrypted line from the file.
:return: information about single princess
"""
print(extract_information("Marni FIGHTS FOR LIFE Old Shack Will rule the kingdom"))
# => ['Marni', 'FIGHTS FOR LIFE', 'Old Shack', 'Will rule the kingdom']