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
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
English,
6 months ago
Hindi,
6 months ago
Political Science,
6 months ago
Math,
1 year ago
Science,
1 year ago