How to zoom in and zoom out camera?

Can anyone please provide a python implementation?