Re: [Tutor] Function help

2014-02-24 Thread Peter Otten
Scott W Dunning wrote: > > On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote: >> If you want to make rows with more or less stars, or stars in other >> colors you could add parameters: >> >> def star_row(numstars, starcolor): >>for i in range(numstars): >>fillstar(sta

Re: [Tutor] Function help

2014-02-24 Thread Alan Gauld
On 24/02/14 02:04, Scott W Dunning wrote: *Also, does anyone know anything about turtle where I can try and move the starting point to the upper left hand corner? * dir() and help() are your friends. After doing dir(turtle) I spooted this likely looking candidate and ran help on it: ---

Re: [Tutor] Function help

2014-02-24 Thread Scott W Dunning
On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote: > which still shows a repetetive pattern and thus you can simplify it with > another loop. You should be able to find a way to write that loop with two > star_row() calls on a single iteration, but can you do it with a single call

Re: [Tutor] Function help

2014-02-24 Thread Scott W Dunning
On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote: > If you want to make rows with more or less stars, or stars in other colors > you could add parameters: > > def star_row(numstars, starcolor): >for i in range(numstars): >fillstar(starcolor) >space(25) > > Y

Re: [Tutor] Function help

2014-02-24 Thread Scott W Dunning
On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote > a programmer would think "for loop” immediately That’s what I thought. It just seemed like way to much to keep repeating everything over and over. I knew there had to be a better way we just haven’t learned loops in school yet.

Re: [Tutor] Function help

2014-02-24 Thread Scott W Dunning
On Feb 23, 2014, at 5:31 AM, Dave Angel wrote: > > Welcome to the tutor forum also, Scott. You'll find it works very > similarly to python-list, and has many of the same people on it. > I'm not sure how you tried to attach source, but please be aware > that this is a text list - anything othe

Re: [Tutor] Function help

2014-02-23 Thread Dave Angel
Scott W Dunning Wrote in message: > I am VERY new to python (programming too). I had a question regarding > functions. Is there a way to call a function multiple times without > recalling it over and over. Meaning is there a way I can call a function and > then add *5 or something like that

Re: [Tutor] Function help

2014-02-23 Thread Ben Finney
Scott W Dunning writes: > I am VERY new to python (programming too). Welcome! You should establish the fundamentals of Python, by working through the Python tutorial http://docs.python.org/3/tutorial/>. Begin at the beginning, and execute all the examples, and experiment with them to satisfy y

Re: [Tutor] Function help

2014-02-23 Thread Peter Otten
Scott W Dunning wrote: > > On Feb 23, 2014, at 1:12 AM, Scott W Dunning wrote: > >> I am VERY new to python (programming too). I had a question regarding >> functions. Is there a way to call a function multiple times without >> recalling it over and over. Meaning is there a way I can call a

Re: [Tutor] Function help

2014-02-23 Thread Scott W Dunning
On Feb 23, 2014, at 1:12 AM, Scott W Dunning wrote: > I am VERY new to python (programming too). I had a question regarding > functions. Is there a way to call a function multiple times without > recalling it over and over. Meaning is there a way I can call a function and > then add *5 or

[Tutor] Function help

2014-02-23 Thread Scott W Dunning
I am VERY new to python (programming too). I had a question regarding functions. Is there a way to call a function multiple times without recalling it over and over. Meaning is there a way I can call a function and then add *5 or something like that? I am trying to code an American Flag usin

Re: [Tutor] function help

2011-02-07 Thread Steven D'Aprano
Ashley F wrote: ok...here's the function I've written so far. def padWithGaps(seq): for letter in seq: letter="-" line=len(seq) dashline=line*letter return dashline I don't think that's a useful function. It seems to do a HUGE amount of work that just keeps get

Re: [Tutor] function help

2011-02-07 Thread James Reynolds
I'm not sure of the answer to your question, because i'm not sure I understand it. Perhaps you could rephrase it? But, there is some other stuff I noticed though: def padWithGaps(seq): for letter in seq: letter="-" line=len(seq) dashline=line*letter return dashli

[Tutor] function help

2011-02-07 Thread Ashley F
ok...here's the function I've written so far.   def padWithGaps(seq):     for letter in seq:    letter="-"    line=len(seq)    dashline=line*letter     return dashline   def replace(someString,position,letter):     first=someString[0:position]     second=letter     third=someString[posi