Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (anonymous):

A host of Python questions.

OpenStudy (anonymous):

1-In python, how could I code an iterative function upon a number, stopping after x iterations? 2- Is there a way of coding: [if it is before the xth iteration, go back to line a (containing y=f(x)) and make replace x with y]?

OpenStudy (anonymous):

Same question, really.

OpenStudy (anonymous):

1 there are loops in python too. 2 I am not sure i understand what you are trying to say

OpenStudy (anonymous):

Okay, an example: how would you, starting with x_1=2 \[f(x_{n+1})=x_n^2-x_n\] Do 10 iterations of this function?

OpenStudy (anonymous):

Actually, I want\[f(x_{n+1})=x_n-\frac{2x_n^3-9x_n+3}{6x_n^2-9}\]

OpenStudy (anonymous):

What is wrong with i=2 a=0 while a<10: i = i-(((2*i*i*i)-(9*i*i)+3)/((6*i*i)-9)) a = a + 1 print(i)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!