Write a program to print a specific star pattern, such as a pyramid or diamond.
Implement print_star_pattern(n, pattern), where n is the number of stars in the widest row and pattern is either "pyramid" or "diamond". Return the pattern as a newline-separated string without a trailing newline. For example, n = 3 with "pyramid" returns `" *
, while n = 2with"diamond"returns" **"`.
def print_star_pattern(n, pattern):