How can i transformation this code in sage?

asked 2017-12-03 16:25:15 +0100

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 P.show ()

edit retag flag offensive close merge delete

Comments

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

this
is
nicely indented
code

Moreover, what is your question?

vdelecroix gravatar imagevdelecroix ( 2017-12-03 16:50:24 +0100 )edit
1

Is this aimed to provide a solution to an exercise given at https://ask.sagemath.org/question/398... ?

tmonteil gravatar imagetmonteil ( 2017-12-03 21:54:53 +0100 )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)

produces:

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 19:35:50 +0100 )edit