## Plotting Simple Functions in 3 Lines with Python

### posted on: Tuesday, March 6, 2012 (11:13 am) by Chase Stevens

You can hardly even tell that I took a course on functional programming last semester.

import turtle
eq = "(x ** 2) / 1.5"
map((lambda x: turtle.setx(x[0]) or turtle.sety(x[1])),[(n,(eval(eq.replace("x","(" + str(n) + ")")))) for n in range(0,100)])

Tags:

*code, lambda, math, programming, python*