fork download
  1. # your code goes here
  2. lista = [12, -2, 4, 8, 29, 45, 78, 36, -17, 2, 12, 8, 3, 3, -52]
  3.  
  4. for n in lista:
  5. if n < 0:
  6. soma_dos_negativos = sum(n)
  7. print('A soma dos elementos negativos é igual a {}'.format(soma_dos_negativos))
Runtime error #stdin #stdout #stderr 0.12s 23516KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 6, in <module>
TypeError: 'int' object is not iterable