davegimo

es3

May 4th, 2022
935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. def lista_pari(l):
  2.    
  3.     l_finale = []
  4.    
  5.     for i in range(len(l)):
  6.         if l[i] % 2 == 0:
  7.             l_finale.append(l[i])
  8.  
  9.  
  10.     return l_finale
  11.  
  12.  
  13.  
  14. l = [3,7,6,5,99,98,70]
  15. print(lista_pari(l))
  16.  
Advertisement
Add Comment
Please, Sign In to add comment