dictionary = {} words = input("Introduce la lista de palabras y traducciones en formato palabra:traducción separadas por comas: ") for i in words.split(','): key, value = i.split(':') dictionary[key] = value phrase = input('Introduce una frase en español: ') for i in phrase.split(): if i in dictionary: print(dictionary[i], end=' ') else: print(i, end=' ')
You can use the following code to fix the indentation of your code. It will indent the code by 4 spaces. import sys import os import re import time import datetime import subprocess import shlex import shutil import glob import argparse import textwrap import pprint import traceback import logging import logging.handlers