[Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-13 Thread kinuthiA muchanE
On Wed, 2008-08-13 at 16:59 +0200, [EMAIL PROTECTED] wrote: > > Message: 5 > Date: Wed, 13 Aug 2008 09:58:52 -0500 > From: "W W" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] What has Editor X got that PyWin32 hasn't? > To: "Dick Moores" <[EMAIL PROTECTED]> > Cc: Python Tutor List > Message-ID: >

Re: [Tutor] Tutor Digest, Vol 53, Issue 110

2008-07-31 Thread kinuthiA muchanE
> > Message: 5 > Date: Thu, 31 Jul 2008 09:07:22 -0400 > From: "S Python" <[EMAIL PROTECTED]> > Subject: [Tutor] Reading List from File > To: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Everyone, > > I am trying to read a

Re: [Tutor] Memroy Error - how to manage large data sets?

2008-07-29 Thread kinuthiA muchanE
ROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=original > > "kinuthiA muchanE" <[EMAIL PROTECTED]> wrote > > > I have realised that when you need to work with large numbers, > lists > > are

Re: [Tutor] Tutor Digest, Vol 53, Issue 99

2008-07-28 Thread kinuthiA muchanE
On Tue, 2008-07-29 at 01:12 +0200, [EMAIL PROTECTED] wrote: > Message: 3 > Date: Mon, 28 Jul 2008 13:26:13 -0500 > From: "Daniel Sarmiento" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Memory error - how to manage large data sets? > To: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> >

Re: [Tutor] Newbie

2008-07-25 Thread kinuthiA muchanE
On Fri, 2008-07-25 at 03:47 +0200, [EMAIL PROTECTED] wrote: > Message: 9 > Date: Thu, 24 Jul 2008 18:47:32 -0700 (PDT) > From: Sam Last Name <[EMAIL PROTECTED]> > Subject: [Tutor] Newbie > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us-ascii" > > m

Re: [Tutor] Tutor Digest, Vol 53, Issue 18

2008-07-05 Thread kinuthiA muchanE
On Sat, 2008-07-05 at 20:23 +0200, [EMAIL PROTECTED] wrote: > Message: 7 > Date: Sat, 05 Jul 2008 12:23:36 -0600 > From: Nathan Farrar <[EMAIL PROTECTED]> > Subject: [Tutor] Exploring the Standard Library > To: Python Tutor > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us

[Tutor] Problem Euler 26

2008-06-29 Thread kinuthiA muchanE
Hi, I am trying to solve Problem Number 26 (http://projecteuler.net/index.php?section=problems&id=26) on project Euler but apparently the answer I am submitting is wrong. Here is the problem: A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denom

Re: [Tutor] Tutor Digest, Vol 52, Issue 87

2008-06-29 Thread kinuthiA muchanE
On Sun, 2008-06-29 at 10:20 +0200, [EMAIL PROTECTED] wrote: > Message: 1 > Date: Sat, 28 Jun 2008 21:53:44 -0400 > From: Kirk Z Bailey <[EMAIL PROTECTED]> > Subject: [Tutor] arrays in python > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; fo

[Tutor] Invoking Python

2008-06-26 Thread kinuthiA muchanE
On Thu, 2008-06-26 at 09:57 -0400, bhaaluu wrote: > You can create a Python script on a *nix system and run it with: > > $ python threeplusfour.py > > You can place a shebang line as the first line of the script, which points > to the python interpreter: > > #!/usr/bin/python > print("Hello, wo

[Tutor] Invoking Python

2008-06-26 Thread kinuthiA muchanE
On Thu, 2008-06-26 at 12:00 +0200, [EMAIL PROTECTED] wrote: > Or more commonly add a first line like: > > #! /path/to/python/executable > > Then you can simply make the file executable and run it by typing its > name > > $ threeplusfour.py On my computer, running Linux Ubuntu, I always have t

[Tutor] Invoking Python

2008-06-25 Thread kinuthiA muchanE
On Tue, 2008-06-24 at 11:11 -0700, Danny Laya wrote: > ... or you could start you fire up a text editor (something like > Notepad > in Windows, or nano in Linux and type "3+4"(without the quotes!), > hmmm..., and save the file as anything you want, lets say for now you > save the file as "threeP

Re: [Tutor] Tutor Digest, Vol 52, Issue 69

2008-06-25 Thread kinuthiA muchanE
On Wed, 2008-06-25 at 01:49 +0200, [EMAIL PROTECTED] wrote: > > ... or you could start you fire up a text editor (something like > > Notepad > > in Windows, or nano in Linux and type "3+4"(without the quotes!), > > Actually it would need to be > > print 3+4 > > otherwise Python would silently

Re: [Tutor] Tutor Digest, Vol 52, Issue 66

2008-06-24 Thread kinuthiA muchanE
On Tue, 2008-06-24 at 15:26 +0200, [EMAIL PROTECTED] wrote: > Message: 5 > Date: Tue, 24 Jun 2008 05:47:29 -0700 (PDT) > From: Danny Laya <[EMAIL PROTECTED]> > Subject: [Tutor] fibonacci.py task ??? > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8

[Tutor] Two dimesional array

2008-06-19 Thread kinuthiA muchanE
On Thu, 2008-06-19 at 02:30 +0200, [EMAIL PROTECTED] wrote: > Message: 2 > Date: Wed, 18 Jun 2008 19:43:21 +0530 > From: "amit sethi" <[EMAIL PROTECTED]> > Subject: [Tutor] (no subject) > To: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859

Re: [Tutor] RegEx to search for the '$' symbol

2008-06-11 Thread kinuthiA muchanE
> -- > > Message: 4 > Date: Wed, 11 Jun 2008 10:35:30 +0100 (GMT+01:00) > From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > Subject: [Tutor] RegEx to search for the '$' symbol > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain;charset="U

Re: [Tutor] Equivalent 'case' Statement

2008-05-23 Thread Kinuthia Muchane
Hi, I messed in earlier message, my apologies. Message: 1 Date: Fri, 23 May 2008 00:25:23 +0100 From: "Alan Gauld" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Equivalent 'case' statement To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; format=flowed; charset="iso-8859-1

Re: [Tutor] Tutor Digest, Vol 51, Issue 51

2008-05-23 Thread Kinuthia Muchane
[EMAIL PROTECTED] wrote: Send Tutor mailing list submissions to tutor@python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/tutor or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can

Re: [Tutor] String Replacement Question

2008-05-21 Thread Kinuthia Muchane
^ No extra space. Ah...Okay! On Wed, May 21, 2008 at 9:42 AM, Kinuthia Muchane <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: st = "String" print "%s " %st*3 String String String Does this help? Kinuth

[Tutor] String Replacement Question

2008-05-21 Thread Kinuthia Muchane
st = "String" print "%s " %st*3 String String String Does this help? Kinuthia... - Message: 6 Date: Wed, 21 May 2008 15:05:21 +0530 From: Faheem <[EMAIL PROTECTED]> Subject: [Tutor] String Replacement question To: tutor@python.org Message-ID: <[EMAIL PROTECTED]>

Re: [Tutor] Else Clause In A Loop

2008-05-13 Thread kinuthia muchane
On Tue, 2008-05-13 at 11:09 -0400, "Simón A. Ruiz" wrote: > kinuthia muchane wrote: > > On Mon, 2008-05-12 at 14:08 -0400, "Simón A. Ruiz" wrote: > >> For each of those numbers, it checks to see if any number between 2 and > >> i is divisible i

Re: [Tutor] Else Clause In A Loop

2008-05-12 Thread kinuthia muchane
t; range(2,2) is is an empty list, so the loops ends uneventfully without > doing anything and the else clause is executed. > > I'm not an expert, and this seems to me to be what's happening there. > > Simón All the same, thanks... > > kinuthia muchane wrote: >

[Tutor] Else Clause In A Loop

2008-05-12 Thread kinuthia muchane
Hi, I learnt that a loop can have an else clause. And that this clause executes when the loop TERMINATES. In a while loop when the condition becomes false, and in a for loop when a sequence is exhausted. When I write the following code it seems to work: for n in [1,2,3,4,5]: print 'we are

[Tutor] Euler Problem 6

2008-04-24 Thread kinuthia muchane
Hi, I think I need to be more careful in the future. This line return sum([k*k for k in range(1,111)]) should be: return sum([k*k for k in range(1,101)]). ... and this one sum([k for k in range(1,101)) also changes to: sum([k for k in range(1,101)) Kinuthia... _

[Tutor] Project Euler Problem 6

2008-04-24 Thread kinuthia muchane
Hi, I am trying to solve problem 6 on the Project Euler, but when I submit my answer, I am told that it is wrong. Here is the problem: The sum of the squares of the first ten natural numbers is, 1² + 2² + ... + 10² = 385 The square of the sum of the first ten natural num

[Tutor] Computing factorial...

2008-04-21 Thread kinuthia muchane
Hi, I wanted to calculate the factorial of a given number without using recursion. I came up with the following code, although it is not very elegant it works. def factorial(*args): product = args[0] for item in args[1:]: product *= item return product number

Re: [Tutor] Tutor Digest, Vol 50, Issue 63

2008-04-20 Thread kinuthia muchane
> "kinuthia muchane" <[EMAIL PROTECTED]> wrote > > > I do not know what I am doing wrong. When I run the following code > > from > > the Python prompt it executes without a murmur. But when I save it > > as > > a .py file and try to execu

Re: [Tutor] Executing from Python prompt

2008-04-20 Thread kinuthia muchane
On Sat, 2008-04-19 at 16:06 -0400, bob gailer wrote: > kinuthia muchane wrote: > > Hi, > > > > I do not know what I am doing wrong. When I run the following code from > > the Python prompt it executes without a murmur. But when I save it as > > a .py file and try

Re: [Tutor] Executing from Python prompt

2008-04-19 Thread kinuthia muchane
Hi, I do not know what I am doing wrong. When I run the following code from the Python prompt it executes without a murmur. But when I save it as a .py file and try to execute it from the shell, it just returns the prompt...actually it is all scripts that return a value which are behaving in this

Re: [Tutor] Tutor Digest, Vol 50, Issue 56

2008-04-18 Thread kinuthia muchane
> > -- > > Message: 3 > Date: Thu, 17 Apr 2008 10:58:00 -0700 > From: Dick Moores <[EMAIL PROTECTED]> > Subject: Re: [Tutor] python assignments > To: Python Tutor List > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us-ascii"; format=flowed >

Re: [Tutor] Tutor Digest, Vol 50, Issue 43

2008-04-14 Thread kinuthia muchane
> > Message: 1 > Date: Mon, 14 Apr 2008 01:31:41 -0700 > From: "Dinesh B Vadhia" <[EMAIL PROTECTED]> > Subject: [Tutor] encode unicode strings from pysqlite > To: > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > Here is a program that SELECT's from a pysqli