How can I code with python in AI of Google Ai Studio?

Python code using in structured prompts

I’m unsure what you mean. Do you mean getting the AI script in python? Or letting the AI use python?

If you mean the second one - enable “Code Execution”, then the AI can run python scripts and retrieve the output.