Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.034 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'parameters': 0.04; '21,': 0.07; 'see.': 0.07; 'variables': 0.07; 'subject:help': 0.08; 'messing': 0.09; 'parameter': 0.09; 'subject:Function': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; 'wrote': 0.14; 'color.': 0.16; 'somewhere.': 0.16; 'star.': 0.16; 'subject:turtle': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'bit': 0.19; 'trying': 0.19; 'received:10.0.1': 0.19; 'starts': 0.20; 'feb': 0.22; '>>>': 0.22; 'programming': 0.22; '(in': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; '': 0.91; 'angel': 0.91; 'scott': 0.93 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020206.53081B9E.004D,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.0 cv=H/cFNZki c=1 sm=1 a=MB85R812cvcrhCHz/P2OVA==:17 a=G8Uczd0VNMoA:10 a=kviXuzpPAAAA:8 a=l_aXpHVjmqQA:10 a=EsSkKGVBSmiBsIcWjwwA:9 a=pILNOxqGKmIA:10 a=4vB-4DCPJfMA:10 a=M863-sWyYjSFvpt9g4cA:9 a=_W_S_7VecoQA:10 a=ZJCZYjxfiXwA:10 a=MB85R812cvcrhCHz/P2OVA==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=swdunning@cox.net Content-Type: multipart/alternative; boundary="Apple-Mail=_AD206F8B-74B4-4A30-AF2A-9D64072D8FD6" Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Function and turtle help From: Scott W Dunning In-Reply-To: Date: Fri, 21 Feb 2014 20:38:02 -0700 References: <75339005-9609-48D8-9DEF-EF0B0CEE7B39@cox.net> To: Dave Angel X-Mailer: Apple Mail (2.1827) Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 147 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393041974 news.xs4all.nl 2834 [2001:888:2000:d::a6]:52289 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66873 --Apple-Mail=_AD206F8B-74B4-4A30-AF2A-9D64072D8FD6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Feb 21, 2014, at 7:13 PM, Dave Angel wrote: > Scott W Dunning Wrote in message: >>=20 >> On Feb 20, 2014, at 11:30 PM, Dave Angel wrote: >>=20 >>> Look at turtle.begin_fill and turtle.end_fill >>>=20 >>> That's after making sure your star is a closed shape. >>=20 >>=20 >>=20 >> So, this is what I have so far and it =93works=94 but, it fills in = the star with black and as you can see below I am trying to fill it in = with red. So I=92m obviously messing up somewhere. =20 >>=20 >> def fillcolor(red): >> pencolor() >> begin_fill() >> star(500) >> end_fill() >>=20 >> red =3D pencolor >> fillcolor(red) >>=20 >=20 > You seem to have a fundamental misunderstanding of how variables > and function parameters work. Yes I just learned a little bit about functions a couple days ago in = school. I am completely new to programming so thanks for any help! >=20 >> def fillcolor(red): > The parameter should be something like color, not red. Ok I see. =20 I changed it a little based on what you suggested and I got a change, = the outline became red but the fill is still black. Can you walk me = through where I=92m going wrong on what I have below? =20 =46rom what I gather, I have a function called fillcolor with a = parameter called color. I know this is going to sound stupid but I get = a little lost after that. The function says when ever I call fillcolor = do what=92s in the body? What exactly does the parameter do (in this = case color, how is that doing anything) and what is an argument? =20 def fillcolor(color): <- Function with parameter, right? pencolor(color) <- Says make pencolor whatever I state when I = call fill color, right? =09 begin_fill() <- starts filling the star. When I put = color in () though I get an error that it takes no arguments? star(500) <- Star function=20 end_fill() <- Ends fill red =3D "red" fillcolor(red) I know that I know absolutely nothing but I=92m trying and I just = started so please bare with me. And thanks for any help, it's GREATLY = appreciated!! Scott --Apple-Mail=_AD206F8B-74B4-4A30-AF2A-9D64072D8FD6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
On Feb 21, 2014, at 7:13 PM, Dave = Angel <davea@davea.name> = wrote:

Scott W Dunning <swdunning@cox.net> Wrote in = message:

On Feb 20, 2014, at 11:30 PM, = Dave Angel <davea@davea.name> = wrote:

Look at turtle.begin_fill and = turtle.end_fill

That's after making sure your star is a closed = shape.



So, this is what I have so far and it = =93works=94 but, it fills in the star with black and as you can see = below I am trying to fill it in with red.  So I=92m obviously = messing up somewhere.  

def = fillcolor(red):
   pencolor()
   begin= _fill()
   star(500)
   end_fill()
=
red =3D pencolor
fillcolor(red)


You seem = to have a fundamental misunderstanding of how variables
and function = parameters work.

Yes I just learned = a little bit about functions a couple days ago in school.  I am = completely new to programming so thanks for any = help!


def = fillcolor(red):
  The parameter should be = something like color, not red.

Ok I see. =  

I changed it a little based on what = you suggested and I got a change, the outline became red but the fill is = still black.  Can you walk me through where I=92m going wrong on = what I have below?  

=46rom what I gather, = I have a function called fillcolor with a parameter called color. =  I know this is going to sound stupid but I get a little lost after = that.  The function says when ever I call fillcolor do what=92s in = the body?  What exactly does the parameter do (in this case color, = how is that doing anything) and what is an argument? =  

def fillcolor(color):   =  <- Function with parameter, right?
  =   pencolor(color)     <- Says make pencolor = whatever I state when I call fill color, right?   =
    begin_fill()   =     <- starts filling the star.  When I put color = in () though I get an error that it takes no = arguments?
    star(500)   =     <- Star function 
    = end_fill() =       <- Ends = fill

red =3D = "red"
fillcolor(red)


I = know that I know absolutely nothing but I=92m trying and I just started = so please bare with me.  And thanks for any help, it's GREATLY = appreciated!!

Scott


=
= --Apple-Mail=_AD206F8B-74B4-4A30-AF2A-9D64072D8FD6--