## formula()


Generate the molecular formula of a geometry in Hill order.


Usage

``` python
formula(geo)
```


With carbon present, C comes first, then H, then the remaining elements alphabetically. Without carbon, all elements (including H) are alphabetical.


## Parameters


`geo: Geometry`  
Geometry.


## Returns


`str`  
Molecular formula.


## Examples

``` python
    >>> import autogeom
    >>> autogeom.formula(autogeom.from_smiles("CO"))
```

    'CH4O'

``` python
    >>> autogeom.formula(autogeom.from_smiles("Cl"))
```

    'ClH'
