human
Write a function to compute the n-th power of each number in a list. Here is a solution in Python: Can you provide a Python code to compute the n-th power of each number in a list?
assistant
#Here is Python code to compute the n-th power of each number in a list.
 def nth_nums(nums,n):
 nth_nums = list(map(lambda x: x ** n, nums))
 return nth_nums