SMILES (Simplified Molecular Input Line Entry System) and InChI (International Chemical Identifier) are both methods of representing chemical structures in a machine-readable form.

SMILES is a string-based representation of a molecule, where each element and bond is represented by a set of symbols. SMILES strings are concise and can be easily read by humans, making them a useful format for exchanging chemical information.

InChI is a more standardized representation of a chemical structure, designed to be machine-readable and unambiguous. InChI strings provide a unique identifier for a chemical substance, and they can be used to encode molecular structure information, including the arrangement of atoms, the bond order, and the stereochemistry of the molecule.

Here is an example of a Python code to convert between SMILES and InChI using the RDKit library:

from rdkit import Chem

def smiles_to_inchi(smiles):
    mol = Chem.MolFromSmiles(smiles)
    inchi = Chem.MolToInchi(mol)
    return inchi

def inchi_to_smiles(inchi):
    mol = Chem.MolFromInchi(inchi)
    smiles = Chem.MolToSmiles(mol)
    return smiles

In this example, the Chem.MolFromSmiles function is used to create a molecular object from a SMILES string, and the Chem.MolToInchi function is used to convert the molecular object to an InChI string. Similarly, the Chem.MolFromInchi function is used to create a molecular object from an InChI string, and the Chem.MolToSmiles function is used to convert the molecular object to a SMILES string.