Hi,
Sorry if this is a dumb question, but I am only a week into coding. I have a list that is comprised of integers. I would like to add these all together, but I can't seem to do it correctly.
broken_prices = [5, 3, 4, 5, 4] + [4]
Thanks in advance
Sorry if this is a dumb question, but I am only a week into coding. I have a list that is comprised of integers. I would like to add these all together, but I can't seem to do it correctly.
broken_prices = [5, 3, 4, 5, 4] + [4]
def sum_list(broken_pieces): sum = 0 for x in broken_pieces: sum += x return sumBasically, I am trying to write code that will return the total of the numbers in the list, which would be 25.
Thanks in advance