Not much of Python is exposed through Ansible. Almost none in fact. Unless you're deciding to write your own modules, and even then you don't have to use Python. From a user's perspective Ansible is mostly YAML and Jinja2 filters.
Chef on the other hand is Ruby. Pretty much fully exposed as such.
Chef on the other hand is Ruby. Pretty much fully exposed as such.