Re: a simple question

2021-07-29 Thread Sean DiZazzo
On Tuesday, July 27, 2021 at 5:05:27 AM UTC-7, Terry Reedy wrote: > On 7/26/2021 6:19 PM, Glenn Wilson via Python-list wrote: > > I recently downloaded the latest version of python, 3.9.6. Everything works > > except, the turtle module. I get an error message every time , I use basic > > command

Re: a simple question

2021-07-27 Thread Terry Reedy
On 7/26/2021 6:19 PM, Glenn Wilson via Python-list wrote: I recently downloaded the latest version of python, 3.9.6. Everything works except, the turtle module. I get an error message every time , I use basic commands like forward, backward, right and left. My syntax is correct: pat.forward(10

RE: a simple question

2021-07-26 Thread Avi Gross via Python-list
the way they probably did not write proper code in the first place that loads the module(s) they need? -Original Message- From: Python-list On Behalf Of Dennis Lee Bieber Sent: Monday, July 26, 2021 9:46 PM To: python-list@python.org Subject: Re: a simple question On Mon, 26 Jul 2021 22:19

Re: a simple question

2021-07-26 Thread dn via Python-list
On 27/07/2021 10.19, Glenn Wilson via Python-list wrote: > I recently downloaded the latest version of python, 3.9.6. Everything works > except, the turtle module. I get an error message every time , I use basic > commands like forward, backward, right and left. My syntax is correct: > pat.forwa

Re: a simple question

2021-07-26 Thread Paul Bryan
It would help to know the error message you get every time. On Mon, 2021-07-26 at 22:19 +, Glenn Wilson via Python-list wrote: > I recently downloaded the latest version of python, 3.9.6. Everything > works except, the turtle module. I get an error message every time , > I use basic commands l

Re: A simple question

2006-03-04 Thread Tuvas
Ahh, that make sense! Thanks a ton! -- http://mail.python.org/mailman/listinfo/python-list

Re: A simple question

2006-03-04 Thread Ben Cartwright
Tuvas wrote: > Why is the output list [[0, 1], [0, 1]] and not [[0, > 1], [0, 0]]? And how can I make it work right? http://www.python.org/doc/faq/programming.html#how-do-i-create-a-multidimensional-list --Ben -- http://mail.python.org/mailman/listinfo/python-list

Re: A simple question

2006-03-04 Thread [EMAIL PROTECTED]
Skip answered why, but not how to make it work right: >>> x = [[0]*2 for x in range(2)] >>> x [[0, 0], [0, 0]] >>> x[0][1]=1 >>> x [[0, 1], [0, 0]] Cheers, n -- http://mail.python.org/mailman/listinfo/python-list

Re: A simple question

2006-03-04 Thread skip
>>> x=[[0]*2]*2 This replicates the references. It doesn't copy objects. This short transcript demonstrates that concept: >>> x = [[0, 0], [0, 0]] >>> map(id, x) [16988720, 16988160] >>> y = [[0]*2]*2 >>> y [[0, 0], [0, 0]] >>> map(id, y) [16988520, 16988520

Re: A simple question string.replace

2006-01-31 Thread bruno at modulix
Haibao Tang wrote: > I have a two-column data file like this > 1.12.3 > 2.211.1 > 4.31.1 > ... > Is it possible to substitue all '1.1' to some value else without using > re. I suppose that you don't want '11.1' to be affected. raw_data=""" 1.12.3 2.211.1 4.31.1 """ data =

Re: A simple question string.replace

2006-01-30 Thread I V
Haibao Tang wrote: > Is it possible to substitue all '1.1' to some value else without using > re. You could try: import sys values = sys.stdin.readline().split() while values: results = [] for value in values: if value != '1.1': results.append(value) else:

Re: A simple question string.replace

2006-01-30 Thread Emile van Sebille
"Haibao Tang" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a two-column data file like this > 1.12.3 > 2.211.1 > 4.31.1 > ... > Is it possible to substitue all '1.1' to some value else without using > re. > Yes -- data = """1.12.3 2.211.1 4.31.1"""

Re: a simple question about the third index in slice

2005-10-20 Thread Fredrik Lundh
someone wrote: > I cannot quite understand when the third index is a negative > number,like this: > a = '0123456789' > a[1:10:2] I know the index step is 2, so it will collect items from > offset 1, 3, 5, 7, 9 > but when a negative number come,like: > a[1::-1] answer '10', and a[1:10:-1] only answ