Math, asked by Sohamdonga337, 1 year ago

Write a python function squareprime(l)that takes a nonempty list of integers and returns true if the elements of l alternate between perfect squares and prime numbers, and returns false otherwise. Note that the alternating sequence of squares and primes may begin with a square or with a prime.

Answers

Answered by truptipandya
0

Write a Python function squareprime(l) that takes a non-empty list of integers and returns True if the elements of l alternate between perfect squares and prime numbers, and returns False otherwise. Note that the alternating sequence of squares and primes may begin with a square or with a prime.

Here are some examples to show how your function should work.

Similar questions