Uno2K

Aula6 - zera_negativos

Sep 16th, 2021
775
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. teste = [1, 2, 3, -1, -2 ,3]
  2.  
  3. def zera_negativos(a):
  4.     for i in range(len(a)):
  5.         a[i] = max(a[i], 0)
  6.     return a
  7.  
  8. print(zera_negativos(teste))
RAW Paste Data