Watch and track your favorite playlist.
Curated by: NPTEL - Indian Institute of Science, Bengaluru (220 videos)
Complex control flow PythonTutor: https://pythontutor.com/render.html#code=def%20is_prime%28n%3A%20int%29%20-%3E%20bool%3A%0A%20%20%20%20if%20n%20%3C%202%3A%0A%20%20%20%20%20%20%20%20return%20False%0A%20%20%20%20sqrt_n%20%3D%20int%28n%20**%200.5%29%0A%20%20%20%20for%20i%20in%20range%282,%20sqrt_n%20%2B%201%29%3A%0A%20%20%20%20%20%20%20%20if%20n%20%25%20i%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20False%0A%20%20%20%20return%20True%0A%0Adef%20prime_product%28data%3A%20list%5Bint%5D%29%20-%3E%20int%3A%0A%20%20%20%20product%20%3D%201%0A%20%20%20%20for%20i%20in%20data%3A%0A%20%20%20%20%20%20%20%20if%20is_prime%28i%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20product%20*%3D%20i%0A%20%20%20%20return%20product%0A%0Aprint%28prime_product%28%5B1,%202,%2013,%2021%5D%29%29&cumulative=false&curInstr=0&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false