Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is one possibility. Suppose A contains the terms of the sequence and we assume they are labelled starting at 1.

A = [(-1)^n/n for n in range(1,20)]
pts = [(i+1,ai) for i,ai in enumerate(A)]
point2d(pts)

The idea is to construct a list of points that consists of ordered pairs $(i,a_{i})$ to be sent as an argument to point2d.

tl; dr

point2d(enumerate(agen(10),1))

Here is one possibility. Suppose A contains the terms of the sequence and we assume they are labelled starting at 1.

A = [(-1)^n/n for n in range(1,20)]
pts = [(i+1,ai) [(i,ai) for i,ai in enumerate(A)]
enumerate(A,1)]
point2d(pts)

The idea is to construct a list of points that consists of ordered pairs $(i,a_{i})$ to be sent as an argument to point2d.

In your case you may be able to construct A as follows:

A = [ai for ai in agen(10)]

Perhaps you could skip that part and directly construct the list of points:

pts = [(i,ai) for i,ai in enumerate(agen(10),1)]

If we are confident enough, then we may just skip all steps and arrive at:

point2d(enumerate(agen(10),1))