Write a python function that takes a number and returns an array of the number duplicated n times


Topic: Write a python function that takes a number and returns an array of the number duplicated n times

Solution

def duplicate_array(num, n):
    num = [num] * n
    return num



List all Python Programs