Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. def fun(lista, krotka):
  2. nowaLista = lista[:]
  3. x, y, z = krotka
  4. for i in range(1, len(lista) - 1):
  5. nowaLista[i] = (lista[i - 1] * x + lista[i] * y + lista[i + 1] * z) / (x + y + z)
  6. return nowaLista
  7.  
  8.  
  9. print(fun([3, 1, 2, 0, 4], (1, 1, 1)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement