You need to use switch_to_frame()
driver.switch_to_frame("result")
driver.switch_to_frame(driver.find_element_by_css_selector("body>iframe"))
driver.find_element_by_css_selector("input.ex2").click()
Once you're done in the iframe
, you can switch back to the top frame using:
driver.switch_to_default_content()