Write a loop that sums every number in nums = [10, 20, 30, 40] and prints the total.
nums = [10, 20, 30, 40]
Expected output:
100