## encode()


Encode a string to bytes.


Usage


``` python
encode(data)
```


See also [decode()](decode.md#gdtest_sphinx_func_role.decode) for the reverse.


## Parameters


`data: str`  
The string to encode.


## Returns


`bytes`  
The encoded bytes.
