Advertisement
valerio_mazza

funzione inserisci

Nov 24th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. def insert(L, n1, n2):
  2. # @param L: list. List of integers
  3. # @param n1, n2: int
  4. # return list
  5.   list_new = []
  6.   for i in range(len(L)):
  7.     list_new.append(L[i])
  8.     if L[i] == n1:
  9.       list_new.append(n2)
  10.   return list_new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement