Write code to check whether a number is prime and print a pattern.
Implement prime_and_pattern(n). Return "Prime" or "Not Prime", followed by a newline-separated pattern containing rows of 1 through n asterisks. For n <= 0, return only the primality result. A positive input's returned pattern must end with a newline.
Function signature: def prime_and_pattern(n):
def prime_and_pattern(n):