Re: [Tutor] Learning a Language

2007-09-23 Thread Boykie Mackay
You could also try the showmedo videos at: http://showmedo.com/videos/python I started with Java and am still learning Java but after just a few days of learning python I knew more about programming in python than I knew about in Java.I have also found it helpful trying out some of the challeng

[Tutor] Optimisation of prime number program (cont. from finding prime numbers)

2007-09-21 Thread Boykie Mackay
Ok,I have learnt how to generate prime numbers and how to 'split' input.The above was to help me solve the second 'SPOJ' challenge,PRIME1.The challenge can be found at I have written my solution and tested it and it works fine,but unfortunat

Re: [Tutor] Income calculator

2007-09-20 Thread Boykie Mackay
d. Being a novice I think it would be something for me to come back to later. On Thu, 2007-09-20 at 08:50 +0100, Alan Gauld wrote: > "Boykie Mackay" <[EMAIL PROTECTED]> wrote > > > doesn't seem to be properly formatted.There should be a comma after > > the &g

Re: [Tutor] Income calculator

2007-09-20 Thread Boykie Mackay
I don't know if it's any help,but the line mentioned in the error message; File "./pyfinances.py", line 18 >print "Your expected earnings for %s is %d" % > (financeLogs['month'], > financeLogs['total']) >^ doesn't seem to be properly formatted.There sh

[Tutor] How to take in 2 or more values from user on a single line (like parameters?)

2007-09-19 Thread Boykie Mackay
Hi again, I have racked my brains and tried googling but to no avail. Is there any simple way of getting parameter input from the user? What I want to do is to type in two (or more) values on the command prompt and have a function do some work on them and return a result.For example say I had a

Re: [Tutor] Finding prime numbers

2007-09-19 Thread Boykie Mackay
Thanks.That's solved! On Wed, 2007-09-19 at 13:01 -0400, [EMAIL PROTECTED] wrote: > > > [EMAIL PROTECTED] wrote on 09/19/2007 12:38:49 PM: > > > Sorry about that. > > > > I have posted the code below: > > > > #!/usr/bin/env python > > > > '''A program to generate prime numbers when given 2 n

Re: [Tutor] Finding prime numbers

2007-09-19 Thread Boykie Mackay
07-09-19 at 12:31 -0400, Michael Langford wrote: > Attachments are a bad thing to send to open mailing lists in general. > > In your case, the list appears to have filtered off the code. Please > paste it in inline. > > --Michael > > On 9/19/07, Boykie Mackay <[

[Tutor] Finding prime numbers

2007-09-19 Thread Boykie Mackay
Hi Guys, Could you please look over my code 'attached' to find and print out prime numbers between to given values.When run it it is showing inaccuracies i.e printing out '49' and '95' as prime numbers. I have been through the code but can't seem to find where I may have gone wrong.I am sure it h

Re: [Tutor] Finding even and odd numbers

2007-09-19 Thread Boykie Mackay
Thanks. The analogy to the decimal system was a big help in getting me to understand the principle. On Wed, 2007-09-19 at 09:47 -0400, taserian wrote: > On 9/19/07, Boykie Mackay <[EMAIL PROTECTED]> wrote: > Hi guys, > > I have come across a bit of

[Tutor] Finding even and odd numbers

2007-09-19 Thread Boykie Mackay
Hi guys, I have come across a bit of code to find if a group of numbers is odd or even.The code snippet is shown below: if not n&1: return false The above should return false for all even numbers,numbers being represented by n.I have tried to wrap my head around the 'not n&1' but I'm failing