I am trying to generate a scatter plot with x in range (0,17) and y = 1/(x**2+1). Here's the code that I use to generate the lambda function for y:
y = [lambda x:1/(x**2+1) for x in range(17)]
y
Apparently it shows this output 17 times:
<function __main__.<listcomp>.<lambda>(x)>,
<function __main__.<listcomp>.<lambda>(x)>,
<function __main__.<listcomp>.<lambda>(x)>,
<function __main__.<listcomp>.<lambda>(x)>,
What did I do wrong with the code above? Thanks!