Hello,
I am learning Python and yesterday I cam across a definition wherein I was
supposed to flatten a list recursively. I am getting the solution properly
but wanted to know if I can optimize the code further.
#!/usr/bin/env python
new_list=[]
def flatten(num_list):
"""
>>> flatten([2
On Wed, Mar 23, 2011 at 5:19 PM, Wayne Werner wrote:
>
> -- Forwarded message --
> From: Lezlie Kline
> Date: Wed, Mar 23, 2011 at 9:30 AM
> Subject: Re: [Tutor] Checksum program
> To: Wayne Werner
>
>
> Wayne,
>
> Thanks! That helped tremendously. Here's my problem with the acc
Forwarding on to the list, as there are many other people who can also
answer the questions.
-- Forwarded message --
From: Lezlie Kline
Date: Wed, Mar 23, 2011 at 9:30 AM
Subject: Re: [Tutor] Checksum program
To: Wayne Werner
Wayne,
Thanks! That helped tremendously. Here's m
Thanks for the links. Yes, I've worked with the tutorials. My work doesn't
flow exactly along those lines, but they do help. I'll look up the the
group you sent too. I appreciate all the extra effort you went to. Many
thanks!!! :)
On Wed, Mar 23, 2011 at 12:26 PM, taserian wrote:
> On Wed,
On Wed, Mar 23, 2011 at 11:11 AM, Lezlie Kline wrote:
> I have a question for the list about the homework rule and the tutoring
> list. If you have a question and you're not asking for your homework or
> past homework to be done for you but you just have questions to be explained
> isn't that wha
I have a question for the list about the homework rule and the tutoring
list. If you have a question and you're not asking for your homework or
past homework to be done for you but you just have questions to be explained
isn't that what tutoring and learning is all about. For example, on my
quest
When replying to the Python Tutor list, please use "Reply All" instead of
just "Reply". I meant to put this in my previous message, but it remained in
"meant to" phase and never got implemented properly. 8-)
I don't think it's been initialized properly, but that's where I don't
understand about t
Hi Lezlie,
Well first off, let me admit I have no idea what checksums are (I be a noobz)
and I can not help you with that part of your program at all, but there are
lots
of people here who can. But since you are new to python, let me comment on some
of the general things I noticed in your cod
On Wed, Mar 23, 2011 at 9:55 AM, Lezlie Kline wrote:
> Tony,
>
> For your question "What's the checksum for a completely empty message
> (i.e., no characters at all)?" Do you mean the value or how do I write it?
> I would think the value would be 0.
>
Correct. Now think of that as your starting po
Lezlie Kline wrote:
> I'm trying to work out the bugs in a program for calculating the checksum
> (modulo 256) of an input string. I'm testing it with my full name and I'm a
> beginner with Python. Here's what I have so far.
>
> def main():
> print"This program creates a checksum for a mess
On Wed, Mar 23, 2011 at 9:09 AM, Lezlie Kline wrote:
> Hi,
>
> I'm trying to work out the bugs in a program for calculating the checksum
> (modulo 256) of an input string. I'm testing it with my full name and I'm a
> beginner with Python. Here's what I have so far.
>
> def main():
> print"Th
Hi,
I'm trying to work out the bugs in a program for calculating the checksum
(modulo 256) of an input string. I'm testing it with my full name and I'm a
beginner with Python. Here's what I have so far.
def main():
print"This program creates a checksum for a message."
name=raw_input("Pl
Peter Otten wrote:
Steven D'Aprano wrote:
files.sort()
the_file_name = files[-1]
You don't need to sort if you want only one file:
the_file_name = max(files)
Nice catch!
--
Steven
___
Tutor maillist - Tutor@python.org
To unsubscribe or chan
13 matches
Mail list logo