<a href="https://colab.research.google.com/github/SzymonSkrobiszewski/ON2022/blob/main/Untitled4.ipynb" target="_parent"></a>


```python
from sympy import*

def lagrange(X, Y, x):
  y = 0; lenght = len(X)
  for i in range(lenght):
    result = 1
    for j in range(lenght):
      if j != i:
        result *= (x - X[j])/(X[i] - X[j])
    y += Y[i] * result
  return int(y)


X = [1,2,3]
Y = [1,4,9]

x = int(input("Podaj punkt: "))
print(lagrange(X,Y, x))
```

    Podaj punkt: 5
    25



```python

```

96d4c1075f26b7ecbb2a4910a6f1ac00aee5a593
ipynb
Jupyter Notebook
Untitled4.ipynb
SzymonSkrobiszewski/ON2022
e71f77001e6cd0739a051423c3b7b36ccdf0dbb5
MIT
Untitled4.ipynb
SzymonSkrobiszewski/ON2022
e71f77001e6cd0739a051423c3b7b36ccdf0dbb5
MIT
Untitled4.ipynb
SzymonSkrobiszewski/ON2022
e71f77001e6cd0739a051423c3b7b36ccdf0dbb5
MIT
Qwen/Qwen-72B
1. YES
2. YES