For this Question: Given the first 2 terms A and B of an Arithmetic Series, tell the Nth term of the series.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>nthAP()</b> that takes the integer A, B, and N as a parameter.

<b>Constraints:</b>
-10^3 <= A <= 10^3
-10^3 <= B <= 10^3
1 <= N <= 10^4Print the Nth term of AP series.Sample Input:
2 3 4

Sample Output:
5

Sample Input:
1 2 10

Sample output:
10, I have written this Solution Code: def nthAP(x, y, z):
    res = x + (y-x) * (z-1)
    print(res), In this Programming Language: Python, Now tell me if this Code is compilable or not?