On 2017-03-09 06:07, Steven D'Aprano wrote:
On Wed, Mar 08, 2017 at 08:29:19PM -0800, Alex Kleider wrote:
Things like this can usually be broken down into their component parts
but I've been unsuccessful doing so:
def f(lst):
res = {}
for item in lst:
method_res =
On Wed, Mar 08, 2017 at 08:29:19PM -0800, Alex Kleider wrote:
> The algorithm I came up with is:
> def make_sublists_of_duplicates(original_list):
> frequency_counter = {}
> for item in original_list:
> _ = frequency_counter.setdefault(item, 0)
> frequency_counter[item] +=
On Wed, Mar 08, 2017 at 08:29:19PM -0800, Alex Kleider wrote:
> Things like this can usually be broken down into their component parts
> but I've been unsuccessful doing so:
>
> def f(lst):
> res = {}
> for item in lst:
> method_res = res.setdefault(item, [])
>
On Thu, Mar 09, 2017 at 01:26:26AM +0530, Sri Kavi wrote:
> I wrote and submitted the following function:
>
> def sublist_duplicates(lst):
> sublists = []
> for item in set(lst):
> sublists.append([item] * lst.count(item))
> return sublists
>
> lst_of_duplicates = [1, 2, 10,
On 03/08/2017 12:56 PM, Sri Kavi wrote:
> As part of my learning, I was participating in a discussion at:
>
>
>
> https://discuss.codecademy.com/t/python-lists-of-duplicated-elements/78151
>
>
>
> It’s about making a function that returns a list of lists, with each list
> being all of the
On 09/03/17 06:06, Alex Kleider wrote:
> It seems you are simply kicking the can down the road rather than
> explaining how it it is that dot notation actually works.
The dot notation is just a method access. Dictionaries
are like any other object and have many methods.
> To access a
On 09/03/17 04:29, Alex Kleider wrote:
>> I'd probably opt for a dictionary:
>>
>> def f(lst):
>> res = {}
>> for item in lst:
>> res.setdefault(item,[]).append(item)
>> return list(res.values())
>>
> The above works BUT
> how
setdefault returns the current value for the key
Alan Gauld via Tutor wrote:
> On 08/03/17 19:56, Sri Kavi wrote:
>
>> It’s about making a function that returns a list of lists, with each list
>> being all of the elements that are the same as another element in the
>> original list.
>
> This is one of those problems where there is probably no
On 2017-03-08 21:14, boB Stepp wrote:
Alex, I think you can break this down as follows:
py3: res = {}
py3: def key_item_to_res(item):
... res.setdefault(item, []).append(item)
...
py3: key_item_to_res(3)
py3: res
{3: [3]}
py3: key_item_to_res(3)
py3: res
{3: [3, 3]}
py3: key_item_to_res(2)
On Wed, Mar 8, 2017 at 10:29 PM, Alex Kleider wrote:
> On 2017-03-08 17:03, Alan Gauld via Tutor wrote:
>>
>> My first reaction was to sort the initial list then iterate
>> over it creating a new sublist for each change of value.
>> But, it only works for homogenous lists.
On 2017-03-08 17:03, Alan Gauld via Tutor wrote:
On 08/03/17 19:56, Sri Kavi wrote:
It’s about making a function that returns a list of lists, with each
list
being all of the elements that are the same as another element in the
original list.
This is one of those problems where there is
On 08/03/17 19:56, Sri Kavi wrote:
> It’s about making a function that returns a list of lists, with each list
> being all of the elements that are the same as another element in the
> original list.
This is one of those problems where there is probably no
definitive "correct" answer just
As part of my learning, I was participating in a discussion at:
https://discuss.codecademy.com/t/python-lists-of-duplicated-elements/78151
It’s about making a function that returns a list of lists, with each list
being all of the elements that are the same as another element in the
original
On Mon, Jan 04, 2016 at 12:34:57PM -0500, Pooja Bhalode wrote:
> Hi, I wanted to check if this program can be used to merge the lists
> together and sort them. This seems to work, but i wanted to check if there
> are drawbacks in writing it in this manner.
>
> My solution:
>
> def
Pooja Bhalode wrote:
> Hi, I wanted to check if this program can be used to merge the lists
> together and sort them. This seems to work, but i wanted to check if there
> are drawbacks in writing it in this manner.
When you start out lists are the natural datatype to use, but as you get
more
Hi,
Yes, I tried sending the mail again in plain text.
But I think I understood the difference there in using built-in sort
function and writing the code without using that.
Thank you
On Mon, Jan 4, 2016 at 12:45 PM, Joel Goldstick
wrote:
> On Mon, Jan 4, 2016 at
Hi, I wanted to check if this program can be used to merge the lists
together and sort them. This seems to work, but i wanted to check if there
are drawbacks in writing it in this manner.
My solution:
def linear_merge(list1, list2):
for num in list2:
list1.append(num)
On Mon, Jan 4, 2016 at 12:34 PM, Pooja Bhalode
wrote:
> Hi, I wanted to check if this program can be used to merge the lists
> together and sort them. This seems to work, but i wanted to check if there
> are drawbacks in writing it in this manner.
>
>
> My solution:
>
>
On Mon, Jan 4, 2016 at 5:35 PM, Danny Yoo wrote:
> On Jan 4, 2016 11:00 AM, "Pooja Bhalode" wrote:
> >
> > Hi, I wanted to check if this program can be used to merge the lists
> > together and sort them. This seems to work, but i wanted to check
On Jan 4, 2016 11:00 AM, "Pooja Bhalode" wrote:
>
> Hi, I wanted to check if this program can be used to merge the lists
> together and sort them. This seems to work, but i wanted to check if there
> are drawbacks in writing it in this manner.
You may be missing some
>
> You may also take a look at this link:
> http://stackoverflow.com/questions/7237875/linear-merging-for-lists-in-python
>
> It appears that the poster was going through Googles python tutorials
Hi Joel,
Ah. Nice catch! Yes, that looks like it. It looks like this comes
from the material at
Hi,
I wanted to check if I can write the following program in this manner as
well.
The problem is to merge the lists together and sort them.The solution they
have given is:
def linear_merge(list1, list2):
result = []
while len(list1) and len(list2):
if list1[0] < list2[0]:
On 04/01/16 16:56, Pooja Bhalode wrote:
> Hi,
> I wanted to check if I can write the following program in this manner as
> well.
>
Can you resend in plain text please?
Your post lost all its formatting so its hard to read
or comment on.
> def linear_merge(list1, list2):
> result = []
> while
On Mon, Jan 4, 2016 at 12:27 PM, Alan Gauld
wrote:
> On 04/01/16 16:56, Pooja Bhalode wrote:
> > Hi,
> > I wanted to check if I can write the following program in this manner as
> > well.
> >
>
> Can you resend in plain text please?
> Your post lost all its formatting
On 04/19/2015 12:07 AM, boB Stepp wrote:
.
Before Peter changed one of these
changeable objects, he had:
a = [1, [x, y], 3]
b = a[:]
Now BOTH a[1] and b[1] now identify the location of the inner list
object, [x, y] . Apparently, Python, in its ever efficient memory
management fashion,
On 04/19/2015 03:08 PM, boB Stepp wrote:
On Sun, Apr 19, 2015 at 6:47 AM, Dave Angel da...@davea.name wrote:
On 04/19/2015 12:07 AM, boB Stepp wrote:
[...]
I hope this is helpful, and, if there are any misstepps, that when
they are revealed both of our understandings will be enhanced!
On Sun, Apr 19, 2015 at 6:23 PM, boB Stepp robertvst...@gmail.com wrote:
On Sun, Apr 19, 2015 at 4:05 PM, Dave Angel da...@davea.name wrote:
On 04/19/2015 03:08 PM, boB Stepp wrote:
Or is the real point that we are adding an abstraction
layer so we don't even have to think about where
In a message of Sun, 19 Apr 2015 17:23:13 -0500, boB Stepp writes:
On Sun, Apr 19, 2015 at 4:05 PM, Dave Angel da...@davea.name wrote:
abstract, and the details are unimportant to the user. For example, the
jython system does not use addresses at all. And an object gets moved
around from time
On Sun, Apr 19, 2015 at 12:24 AM, Cameron Simpson c...@zip.com.au wrote:
On 19Apr2015 15:09, Cameron Simpson c...@zip.com.au wrote:
On 18Apr2015 23:26, boB Stepp robertvst...@gmail.com wrote:
On Sat, Apr 18, 2015 at 11:08 PM, Cameron Simpson c...@zip.com.au wrote:
[...]
Two problems often
On Sun, Apr 19, 2015 at 6:47 AM, Dave Angel da...@davea.name wrote:
On 04/19/2015 12:07 AM, boB Stepp wrote:
[...]
I hope this is helpful, and, if there are any misstepps, that when
they are revealed both of our understandings will be enhanced!
Some of your knowledge of other languages is
On 04/19/2015 06:28 PM, Joel Goldstick wrote:
On Sun, Apr 19, 2015 at 6:23 PM, boB Stepp robertvst...@gmail.com wrote:
On Sun, Apr 19, 2015 at 4:05 PM, Dave Angel da...@davea.name wrote:
On 04/19/2015 03:08 PM, boB Stepp wrote:
Or is the real point that we are adding an abstraction
layer
In a message of Sun, 19 Apr 2015 19:19:27 -0400, Dave Angel writes:
Good answer. The java jvm garbage collector is free to move blocks
around to defrag the free space.
Correct.
FWIW, I'm told the ID value used is a simple integer, that indexes a
list containing the actual addresses.
Also
In a message of Sun, 19 Apr 2015 17:23:13 -0500, boB Stepp writes:
The last sentence in this paragraph has me intrigued. Why would an
object, once it has been created, be moved? What practical benefit
does doing this give?
boB
If you have more than enough memory in your system, you never do
this
On 20/04/15 00:29, Laura Creighton wrote:
So in this case, the binding value is an integer, not an address.
Utterly wrong. The binding value has to be an address.
I think it depends on how you define 'binding' value.
In Python binding is the connection between a name and an object.
So in a
On Sun, Apr 19, 2015 at 4:05 PM, Dave Angel da...@davea.name wrote:
On 04/19/2015 03:08 PM, boB Stepp wrote:
Or is the real point that we are adding an abstraction
layer so we don't even have to think about where objects are
physically stored in RAM?
Somebody keeps track, but the address
Everyone that responded,
Thanks very much for the excellent explanations! The distinction between a
reference to an object and a seperate copy of the object is quite clear now.
--Bill
On Apr 18, 2015 1:44 AM, Alan Gauld alan.ga...@btinternet.com wrote:
On 18/04/15 04:16, Bill Allen wrote:
Bill Allen wrote:
Everyone that responded,
Thanks very much for the excellent explanations! The distinction between
a reference to an object and a seperate copy of the object is quite clear
now.
You can test your newfound knowledge by predicting the output of the
following script:
a =
print(b) will print the original copy of a which b now references which is
[1, [x, y], 3]
On Apr 18, 2015 7:50 AM, Peter Otten __pete...@web.de wrote:
Bill Allen wrote:
Everyone that responded,
Thanks very much for the excellent explanations! The distinction between
a reference to an
On Sat, Apr 18, 2015 at 3:28 PM, Bill Allen walle...@gmail.com wrote:
On Apr 18, 2015 7:50 AM, Peter Otten __pete...@web.de wrote:
Bill Allen wrote:
Everyone that responded,
Thanks very much for the excellent explanations! The distinction between
a reference to an object and a
On Apr 18, 2015 4:11 PM, boB Stepp robertvst...@gmail.com wrote:
On Sat, Apr 18, 2015 at 3:28 PM, Bill Allen walle...@gmail.com wrote:
On Apr 18, 2015 7:50 AM, Peter Otten __pete...@web.de wrote:
Bill Allen wrote:
Everyone that responded,
Thanks very much for the excellent
On Sat, Apr 18, 2015 at 10:03 PM, Bill Allen walle...@gmail.com wrote:
On Apr 18, 2015 4:11 PM, boB Stepp robertvst...@gmail.com wrote:
On Sat, Apr 18, 2015 at 3:28 PM, Bill Allen walle...@gmail.com wrote:
On Apr 18, 2015 7:50 AM, Peter Otten __pete...@web.de wrote:
Bill Allen wrote:
On 18Apr2015 22:03, Bill Allen walle...@gmail.com wrote:
On Apr 18, 2015 4:11 PM, boB Stepp robertvst...@gmail.com wrote:
On Sat, Apr 18, 2015 at 3:28 PM, Bill Allen walle...@gmail.com wrote:
On Apr 18, 2015 7:50 AM, Peter Otten __pete...@web.de wrote:
You can test your newfound knowledge by
On Sat, Apr 18, 2015 at 11:08 PM, Cameron Simpson c...@zip.com.au wrote:
Sometimes you want a deep copy, where b would have got a copy of the
iriginal x-y list. See the copy module's deepcopy function, which
supplies this for when it is needed:
On 18Apr2015 23:26, boB Stepp robertvst...@gmail.com wrote:
On Sat, Apr 18, 2015 at 11:08 PM, Cameron Simpson c...@zip.com.au wrote:
Sometimes you want a deep copy, where b would have got a copy of the
iriginal x-y list. See the copy module's deepcopy function, which
supplies this for when it
On 19Apr2015 15:09, Cameron Simpson c...@zip.com.au wrote:
On 18Apr2015 23:26, boB Stepp robertvst...@gmail.com wrote:
On Sat, Apr 18, 2015 at 11:08 PM, Cameron Simpson c...@zip.com.au wrote:
Sometimes you want a deep copy, where b would have got a copy of the
iriginal x-y list. See the copy
On 18/04/15 04:16, Bill Allen wrote:
If I have a list defined as my_list = ['a','b','c'], what is the is
differnce between refering to it as my_list or my_list[:]? These seem
equivalent to me. Is that the case? Is there any nuance I am missing
here? Situations where one form should be used
Ben Finney ben+pyt...@benfinney.id.au writes:
Bill Allen walle...@gmail.com writes:
If I have a list defined as my_list = ['a','b','c'], what is the is
differnce between refering to it as my_list or my_list[:]?
‘my_list’ is a reference to the object you've already described (the
existing
On 04/17/2015 11:51 PM, Ben Finney wrote:
Ben Finney ben+pyt...@benfinney.id.au writes:
Bill Allen walle...@gmail.com writes:
If I have a list defined as my_list = ['a','b','c'], what is the is
differnce between refering to it as my_list or my_list[:]?
‘my_list’ is a reference to the
If I have a list defined as my_list = ['a','b','c'], what is the is
differnce between refering to it as my_list or my_list[:]? These seem
equivalent to me. Is that the case? Is there any nuance I am missing
here? Situations where one form should be used as opposed to the other?
Thanks,
Bill
Bill Allen walle...@gmail.com writes:
If I have a list defined as my_list = ['a','b','c'], what is the is
differnce between refering to it as my_list or my_list[:]?
‘my_list’ is a reference to the object you've already described (the
existing object ‘['a', 'b', 'c']’).
‘my_list[:]’ is an
Good evening Bill,
If I have a list defined as my_list = ['a','b','c'], what is the
is differnce between refering to it as my_list or my_list[:]?
These seem equivalent to me. Is that the case? Is there any
nuance I am missing here? Situations where one form should be
used as opposed to
My point was: `iter` the func exists in python (built-in with '-'), one may
use it at times. Giving an application var this name hides, which
accosionnally leads to bugs. I have been bitten by such a bug more than once
in the past, and once hard to find, asp. with the built-in func `range` (a
On 01/01/2014 08:04, Danny Yoo wrote:
My point was: `iter` the func exists in python (built-in with '-'), one may
use it at times. Giving an application var this name hides, which
accosionnally leads to bugs. I have been bitten by such a bug more than once
in the past, and once hard to find,
On 31/12/2013 07:30, Keith Winston wrote:
Never mind, I figured out that the slice assignment is emptying the
previous lists, before the .reset() statements are creating new lists
that I then populate and pass on. It makes sense.
On Tue, Dec 31, 2013 at 12:59 AM, Keith Winston
On 12/31/2013 06:59 AM, Keith Winston wrote:
I resolved a problem I was having with lists, but I don't understand how! I
caught my code inadvertently resetting/zeroing two lists TWICE at the
invocation of the game method, and it was leading to all the (gamechutes
gameladders) lists returned by
Thanks Denis, I found out about the iter builtin last night, a few hours
after I'd coded/posted that. Oops. Thanks for your other comments, I am
clearer now about the distinction of creating a new, empty list vs.
clearing the same list out, and the subsequent implications on other
symbols bound to
On 12/31/2013 09:46 PM, Keith Winston wrote:
Thanks Denis, I found out about the iter builtin last night, a few hours
after I'd coded/posted that. Oops. Thanks for your other comments, I am
clearer now about the distinction of creating a new, empty list vs.
clearing the same list out, and the
On Tue, Dec 31, 2013 at 4:27 AM, spir denis.s...@gmail.com wrote:
In addition, iter is also the name of a builtin function, like print.
While iter is a built-in function, it would be clearer if you
referenced the __builtins__ namespace. Built-in objects are linked
into the interpreter, either
On Tue, Dec 31, 2013 at 10:00:32PM -0500, eryksun wrote:
On Tue, Dec 31, 2013 at 4:27 AM, spir denis.s...@gmail.com wrote:
In addition, iter is also the name of a builtin function, like print.
While iter is a built-in function, it would be clearer if you
referenced the __builtins__
On Tue, Dec 31, 2013 at 10:53 PM, Steven D'Aprano st...@pearwood.info wrote:
__builtins__ with-an-s is a crappy hack that has never worked correctly
and has caused more confusion than help:
https://mail.python.org/pipermail/python-3000/2007-March/006170.html
Restricted mode in CPython has
On 01/01/2014 07:13 AM, eryksun wrote:
I'm afraid I've lost the context, and don't understand why this is
important. It's true that not all built-in objects are in builtins, and
not all objects in builtins are built-in, but other than for pedantic
correctness, why does this matter?
Denis said:
I resolved a problem I was having with lists, but I don't understand how! I
caught my code inadvertently resetting/zeroing two lists TWICE at the
invocation of the game method, and it was leading to all the (gamechutes
gameladders) lists returned by that method being zeroed out except the
final
Never mind, I figured out that the slice assignment is emptying the
previous lists, before the .reset() statements are creating new lists that
I then populate and pass on. It makes sense.
On Tue, Dec 31, 2013 at 12:59 AM, Keith Winston keithw...@gmail.com wrote:
I resolved a problem I was
So I have to write a program that reads a message from the user and prints
a new message that contains all the words from the original message but in
the same order without repeating any of them unless they show up more than
once in the original message.
What I have thus far looks like this:
I can't figure out
1) How to remove y from the list and continue the loop; when I use .remove
etc. it runs once then give me the error that y is not in the list.
I imagine the answer is quite simple I'm just getting really frustrated
trying to get this done any advice is appreciated.
This
On 3/28/2012 11:53 AM Ricky Brown said...
So I have to write a program that reads a message from the user and
prints a new message
ok --
that contains all the words from the original
message but in the same order without repeating any of them unless they
show up more than once in the
On Wed, Mar 28, 2012 at 2:53 PM, Ricky Brown rjbr...@gmail.com wrote:
So I have to write a program that reads a message from the user and prints
a new message that contains all the words from the original message but in
the same order without repeating any of them unless they show up more than
On 28/03/2012 21:15, Emile van Sebille wrote:
On 3/28/2012 11:53 AM Ricky Brown said...
So I have to write a program that reads a message from the user and
prints a new message
ok --
that contains all the words from the original
message but in the same order without repeating any of them
Thank you all for your input it was extremely helpful. Robert you were spot
on with what I was trying to do, I tried to implement the random.sample
earlier but I couldn't see to get it too work -- running smoothly now.
Sorry for the trouble :)
On Wed, Mar 28, 2012 at 4:14 PM, Robert Sjoblom
I want to prompt the user only once to enter 5 numbers. I then want to
create a list out of those five numbers. How can I do that?
I know how to do it if I prompt the user 5 different times, but I only want
to prompt the user once.
Thanks.
--
Michael
Hi Michael,
I bet there is a better way (which I would like to see), but here is what I
have come up with for my own uses.
ints = []
u_in = False
while u_in == False:
try:
u_input = raw_input('please enter 5 integers, space separated\n
')
for n in
On 2012/02/07 07:40 AM, Michael Lewis wrote:
I want to prompt the user only once to enter 5 numbers. I then want to
create a list out of those five numbers. How can I do that?
I know how to do it if I prompt the user 5 different times, but I only
want to prompt the user once.
Thanks.
--
To: tutor@python.org
Subject: Re: [Tutor] Lists
Dnia 11-06-2011 o 17:51:03 Piotr Kamińskipiotr-...@o2.pl
napisał(a):
Dnia 11-06-2011 o 17:30:50 Alan Gauldalan.ga...@btinternet.com
napisał(a):
Piotr Kamińskipiotr-...@o2.pl wrote
This is a *technical* list, as I understand it, solely
dedicated
Dnia 11-06-2011 o 17:51:03 Piotr Kamiński piotr-...@o2.pl napisał(a):
Dnia 11-06-2011 o 17:30:50 Alan Gauld alan.ga...@btinternet.com
napisał(a):
Piotr Kamiński piotr-...@o2.pl wrote
This is a *technical* list, as I understand it, solely dedicated to
...
Since this seems to be
Message-
From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-
bounces+bermanrl=cfl.rr@python.org] On Behalf Of Piotr Kaminski
Sent: Sunday, June 12, 2011 4:06 PM
To: tutor@python.org
Subject: Re: [Tutor] Lists
Dnia 11-06-2011 o 17:51:03 Piotr Kamiński piotr-...@o2.pl
Dnia 11-06-2011 o 04:34:47 Steven D'Aprano st...@pearwood.info
napisał(a):
Piotr Kamiński wrote:
Could you please refrain from presenting your *religious* convictions in
this list: the notions you believe in as well as the ones that you
believe
are false?
This is a *technical* list, as I
Piotr Kamiński piotr-...@o2.pl wrote
This is a *technical* list, as I understand it, solely dedicated
to the
technical side of teaching the *Python* programming language and
*programming* in general. I would like to keep it this way ...
Since this seems to be something we can all agree on
Hello,
I've been told that some of you, or everybody got my e-mail four times.
I'm sorry for the inconvenience. It seems there was a temporary failure of
my piotr-kam[at]o2.pl mail account. I tried to send the e-mail three
times, and each time got the Undelivered Mail Returned to Sender
Dnia 11-06-2011 o 17:30:50 Alan Gauld alan.ga...@btinternet.com
napisał(a):
Piotr Kamiński piotr-...@o2.pl wrote
This is a *technical* list, as I understand it, solely dedicated to
the
technical side of teaching the *Python* programming language and
*programming* in general. I would like
On 06/11/2011 06:51 PM, Piotr Kamiński wrote:
Dnia 11-06-2011 o 17:30:50 Alan Gauld alan.ga...@btinternet.com
napisał(a):
Piotr Kamiński piotr-...@o2.pl wrote
This is a *technical* list, as I understand it, solely dedicated
to the
technical side of teaching the *Python* programming
Alan: Thank you for all you do. I always look for your posts! You
have helped me immensely with Python and I appreciate it!
Jeff
---
Jeff Johnson
j...@dcsoftware.com
Jeff
---
Jeff Johnson
j...@san-dc.com
(623) 582-0323
www.san-dc.com
On 06/11/2011 08:30
I'm stuck on two problems from the Absolute Beginners book. The first is
simple.
I am trying to print all the words in the list in random order without repeats,
but it always shows None for some reason.
#Program prints list of words in random order with no repeats
import random
#List of
Vincent Balmori wrote:
I'm stuck on two problems from the Absolute Beginners book. The first is simple.
I am trying to print all the words in the list in random order without repeats,
but it always shows None for some reason.
#Program prints list of words in random order with no repeats
Dnia 10-06-2011 o 12:25:34 Steven D'Aprano st...@pearwood.info
napisał(a):
Vincent Balmori wrote:
I'm stuck on two problems from the Absolute Beginners book. The first
is simple. I am trying to print all the words in the list in random
order without repeats, but it always shows None for
On 06/10/2011 03:12 PM, Piotr Kamiński wrote:
Could you please refrain from presenting your *religious* convictions
in this list: the notions you believe in as well as the ones that you
believe are false?
This is a *technical* list, as I understand it, solely dedicated to
the technical side
Dnia 10-06-2011 o 22:00:46 Corey Richardson kb1...@aim.com napisał(a):
On 06/10/2011 03:12 PM, Piotr Kamiński wrote:
Could you please refrain from presenting your *religious* convictions
in this list: the notions you believe in as well as the ones that you
believe are false?
This is a
Piotr Kamiński wrote:
Could you please refrain from presenting your *religious* convictions in
this list: the notions you believe in as well as the ones that you believe
are false?
This is a *technical* list, as I understand it, solely dedicated to the
technical side of teaching the *Python*
Vincent, you should also try to avoid naming your lists a 'list'. There's a
couple dozen words in Python that are reserved 'for system use':
import keyword
print(keyword.kwlist)
['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue',
'def', 'del', 'elif', 'else',
Hi Gurus
I just wrote my first little python program; so yes I'm very new to all this.
The goal in the end is to have a program that shows how the sun moves from the
point of view of a given location (i.e. solar paths added to some sort of
stereographic diagram).
My very first program
On 11/21/2010 5:12 AM Chris Begert said...
Hi Gurus
I just wrote my first little python program; so yes I'm very new to all this.
The goal in the end is to have a program that shows how the sun moves from the
point of view of a given location (i.e. solar paths added to some sort of
Chris Begert c...@gmx.de wrote
How do I store a years worth of data of angles in an
array / list / whatever is most useful when using Python?
The choice of data structure usually depends on how
you plan on accessing/using it. So we can't advise
until we know more about what you plan on doing
On 11/21/2010 8:12 AM, Chris Begert wrote:
Hi Gurus
I just wrote my first little python program; so yes I'm very new to all this.
The goal in the end is to have a program that shows how the sun moves from the
point of view of a given location (i.e. solar paths added to some sort of
Thanks for all the suggestions. I will have to try this.
--- On Sun, 26/4/09, Kent Johnson ken...@tds.net wrote:
From: Kent Johnson ken...@tds.net
Subject: Re: [Tutor] Lists in a file
To: Robert Berman berma...@cfl.rr.com
Cc: David Holland davholla2...@yahoo.co.uk, tutor python
tutor
Hi,
I am trying to create a program where I open a file full of lists and process
them.
However when the program does not recognize the lists as lists.
Here is the relevant code :-
def open_filedef():
text_file =open (voteinp.txt,r)
lines = text_file.readlines()
for line in
David,
You are processing a text file. It is your job to treat it as a file
comprised of lists. I think what you are saying is that each line in the
text file is a list. In that case
for line in fileobject:
listline = list(line)
Now, listline is a list of the text items in line.
Hope
On Sun, Apr 26, 2009 at 2:18 PM, Robert Berman berma...@cfl.rr.com wrote:
David,
You are processing a text file. It is your job to treat it as a file
comprised of lists. I think what you are saying is that each line in the
text file is a list. In that case
for line in fileobject:
Le Sun, 26 Apr 2009 18:03:41 + (GMT),
David Holland davholla2...@yahoo.co.uk s'exprima ainsi:
Hi,
I am trying to create a program where I open a file full of lists and
process them. However when the program does not recognize the lists as
lists. Here is the relevant code :-
def
Hi
What am I doing wrong
media_list = ['upper_b.wav', 'upper_a.wav']
print '%s' % (for x in media_list)
File stdin, line 1
print '%s' % (for x in media_list)
^
SyntaxError: invalid syntax
print '%s' % (x for x in media_list)
generator object at 0x532210
I want to
On Tue, Jan 20, 2009 at 11:30 AM, Norman Khine nor...@khine.net wrote:
Hi
What am I doing wrong
media_list = ['upper_b.wav', 'upper_a.wav']
print '%s' % (for x in media_list)
File stdin, line 1
print '%s' % (for x in media_list)
^
SyntaxError: invalid syntax
print
hi!
On Tue, Jan 20, 2009 at 10:30 PM, Kent Johnson ken...@tds.net wrote:
On Tue, Jan 20, 2009 at 11:30 AM, Norman Khine nor...@khine.net wrote:
Hi
What am I doing wrong
media_list = ['upper_b.wav', 'upper_a.wav']
print '%s' % (for x in media_list)
File stdin, line 1
print '%s' % (for
1 - 100 of 160 matches
Mail list logo