How can i transformation this code in sage?

asked 2017-12-03 09:25:15 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

P1= ellipse((4,4),3,3, color='purple') + circle((3,5), 0.4) + circle((5,5), 0.4) + polygon([(5,3), (3,3), (4 ,0.999999999)]) P2= plot((x+1), -10, 10, color='white') P= P1 + P2 ()

edit retag flag offensive close merge delete


Could you indent correctly your code so that we can read something (put 4 spaces at each begining of line)

nicely indented

Moreover, what is your question?

vdelecroix gravatar imagevdelecroix ( 2017-12-03 09:50:24 -0500 )edit

Is this aimed to provide a solution to an exercise given at ?

tmonteil gravatar imagetmonteil ( 2017-12-03 14:54:53 -0500 )edit

To display inline code, like f, use backticks.

To display blocks of code or error messages, separate them by a blank line from the rest of the text, and do one of the following (all give the same result):

  • indent all code lines with 4 spaces
  • select code lines and click the "code" button (the icon with '101 010')
  • select code lines and hit ctrl-K

For instance, typing

If we define `f` by

    def f(x, y):
        return (x, y)

then `f(2, 3)` returns `(2, 3)` but `f(2)` gives:

    TypeError: f() takes exactly 2 arguments (1 given)


If we define f by

def f(x, y):
    return (x, y)

then f(2, 3) returns (2, 3) but f(2) gives:

TypeError: f() takes exactly 2 arguments (1 given)

Please edit your question to do that.

slelievre gravatar imageslelievre ( 2017-12-10 12:35:50 -0500 )edit