Create a Pythonically optimized version of the following code.
def add_nums(nums):
    total = 0
    for i in range(len(nums)):
        total += nums[i] 
    return total
def add_nums(nums):
    return sum(nums)