Write a function which takes in a list and a number as an input and returns a list with each list element raised to power of that number


Topic: Write a function which takes in a list and a number as an input and returns a list with each list element raised to power of that number

Solution

def powered_list(a_list, a_number):
    a_list = [math.pow(a_number) for i in a_list]  
    return a_list
        
        



List all Python Programs