Hi Praveen
I am still new to the language but here is what I would do. Sorry I can't
comment on how to best check for efficiency.
my_str='google'
split_by= 2
[ my_str[i:i+split_by] for i in range(0, len(my_str), split_by) ]
Just using a list comprehension.
best,
-Abhi
On Thu, Oct 27, 2011
On 2011/10/28 07:38 AM, Praveen Singh wrote:
splitWord('google', 2)
['go', 'og', 'le']
splitWord('google', 3)
['goo', 'gle']
splitWord('apple', 1)
['a', 'p', 'p', 'l', 'e']
splitWord('apple', 4)
['appl', 'e']
def splitWord(word,
.
Thanks Christian for your links and code
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
options:http://mail.python.org/mailman/listinfo/tutor
Below [1] is how I would write it, which is simply a
On 10/28/2011 01:38 AM, Praveen Singh wrote:
splitWord('google', 2)
['go', 'og', 'le']
splitWord('google', 3)
['goo', 'gle']
splitWord('apple', 1)
['a', 'p', 'p', 'l', 'e']
splitWord('apple', 4)
['appl', 'e']
def splitWord(word, number):
On 28/10/11 03:20, Joe Batt wrote:
I am just starting to try to learn Python on IDLE on a Mac running
Welcome, and don't worry thee are no stupid questions.
And you've given us all the right info to answer too, well done! :-)
Python 3.2.2 (v3.2.2:137e45f15c0b, Sep 3 2011, 17:28:59) and I
Alan Gauld wrote:
On 28/10/11 03:20, Joe Batt wrote:
I am just starting to try to learn Python on IDLE on a Mac running
Welcome, and don't worry thee are no stupid questions.
Was it you or your brother who was killed in the war?
--
Steven
___
It would be nice to generalize the solution so it could also handle
definitions={Deprecated: No longer in use, DEPRECATED: No longer in
use}
These are unique now, but after turning them into lower case not anymore.
new_d = {}
for d in definitions:
try:
On 2011/10/28 11:51 AM, Albert-Jan Roskam wrote:
It would be nice to generalize the solution so it could also handle
definitions={Deprecated: No longer in use, DEPRECATED: No
longer in use}
These are unique now, but after turning them into lower case not anymore.
new_d = {}
for d in
On 28/10/11 08:46, Steven D'Aprano wrote:
Alan Gauld wrote:
On 28/10/11 03:20, Joe Batt wrote:
I am just starting to try to learn Python on IDLE on a Mac running
Welcome, and don't worry thee are no stupid questions.
Was it you or your brother who was killed in the war?
me :-)
--
Hello,
This is my first time using this service so I am unsure what proper
formatting should be. In any case here is my question.
I just downloaded EasyInstall here:
http://peak.telecommunity.com/DevCenter/EasyInstall
In the example section under
Downloading and Installing a
Eric Schles wrote:
Hello,
This is my first time using this service so I am unsure what proper
formatting should be. In any case here is my question.
I just downloaded EasyInstall here:
http://peak.telecommunity.com/DevCenter/EasyInstall
In the example section under
Downloading and Installing
Always reply-all so a copy goes to the tutor list.
Always put your responses following the question rather than at the top
of the email.
On 10/28/2011 8:28 AM, Adrian wrote:
Thats the original alright bob, id like to change keys to lowercase
Thanks
Adrian
Sent from my iPad
On 27 Oct 2011,
lina wrote:
On Fri, Oct 7, 2011 at 9:38 AM, Dave Angel d...@davea.name
mailto:d...@davea.name wrote:
On 10/06/2011 12:21 PM, lina wrote:
snip
Yes. I understand this part now. But how can I print a list consists of the
value of key B + E.
For {'B': [4, 5, 6], 'E': [1, 2, 3]}
Ok boss point noted
Sent from my iPad
On 28 Oct 2011, at 19:05, bob gailer bgai...@gmail.com wrote:
Always reply-all so a copy goes to the tutor list.
Always put your responses following the question rather than at the top of
the email.
On 10/28/2011 8:28 AM, Adrian wrote:
Thats
So far, I have tried a few things. Listed below was my original problem and
my original help.
Eric Schles wrote:
Hello,
This is my first time using this service so I am unsure what proper
formatting should be. In any case here is my question.
I just downloaded EasyInstall here:
On 2011-10-28 20:45, Eric Schles wrote:
The help steven gave me makes sense, except I don't know what it means. How
do you run the command as root?
When I try to run the command in the command line, I get the following
error:
C:\easy_install SQLObject
'easy_install' is not recognized as an
Here is my original problem:
Eric Schles wrote:
Hello,
This is my first time using this service so I am unsure what proper
formatting should be. In any case here is my question.
I just downloaded EasyInstall here:
http://peak.telecommunity.com/DevCenter/EasyInstall
In the example
Hi Eric,
On 28 October 2011 21:10, Eric Schles ericsch...@gmail.com wrote:
Or you add the scripts directory to your PATH:
http://peak.telecommunity.com/DevCenter/EasyInstall#id5
If you can't find out where it's installed, try searching for
easy_install.exe.
HTH, Andreas
Unfortunately,
On 28/10/11 19:45, Eric Schles wrote:
So far, I have tried a few things. Listed below was my original problem
and my original help.
The help steven gave me makes sense, except I don't know what it means.
How do you run the command as root?
That's a Linux thing you don;t need that in
19 matches
Mail list logo