Nested functions
How to write a program that has two functions, called prime() and PrimeOrNot(). The function prime() will take objects in a list L, and it will do the following: 1) It (prime()) will send each element of the list L, one at a time, to the function PrimeOrNot() 2) When an answer is returned from PrimeOrNot(), prime() will add that to a list P(P is initially empty). The function PrimeOrNot() will take in each element of L, from prime(), one at a time, and determine whether it is prime or not. If it is, it will return the value âYesâ back to prime(). Otherwise, it will return the value âNoâ back to prime(). My attempt: L=[1, 2,3,4] P=[] def Prime()?? def PrimeOrNot() : if num>1: for i in L: if (num%I)==0: print(i, 'is not prime') else: print(I, 'is prime') Q: How do I get prime() to send elements of L to PrimeOrNot() 1 at a time?