Displaying a simple table

25 views
Skip to first unread message

CR

unread,
Jan 22, 2015, 3:10:13 PM1/22/15
to sage-s...@googlegroups.com

The assignment is to construct a two-column table that starts at x= -4 and ends with x= 5 with one unit increments between consecutive x values. It should have column headings ‘x’ and ‘f(x)’. I can't find anything helpful on html.table(), which is what we're supposed to use.

I'm pretty familiar with programming, just not with python and I don't know exactly what parameters html.table takes. 

This what I have so far. I just have no idea what to put into the html.table function.

x = var('x')
f(x) = (5 * x^2) - (9 * x) + 4
html.table()

William Stein

unread,
Jan 22, 2015, 3:12:33 PM1/22/15
to sage-support
Are you using sagenb.org, cloud.sagemath.com or sage running on your
own computer?

William
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

John Cremona

unread,
Jan 22, 2015, 3:14:18 PM1/22/15
to SAGE support
I have not used html.table myself, but typing html.table? to get the
online help shows what the parameters are and gives some examples.

John
Message has been deleted

John H Palmieri

unread,
Jan 22, 2015, 3:28:38 PM1/22/15
to sage-s...@googlegroups.com

Another option is to use the "table" function:

    T = table( insert appropriate arguments here )
    html(table)

will produce equivalent output to html.table(...). In fact, that's exactly what html.table(...) does. As John Cremona said, doing

   table?

will give you a help message with information about how to use it.

--
John

CR

unread,
Jan 22, 2015, 3:55:42 PM1/22/15
to sage-s...@googlegroups.com
I figured it out with the help command you guys pointed out. Thanks!
Reply all
Reply to author
Forward
0 new messages