Re: [Tutor] LCM revisited + OOP

2012-11-27 Thread wrw
On Nov 27, 2012, at 8:13 PM, Ray Jones wrote: > > Part I > I am a good way through MIT's Introduction to Computer Science and > Programming as offered through edX. I'm not certain I'm going to pass > the course this first time through, the major hangup being the > understanding of OOP. > > Part

Re: [Tutor] LCM revisited + OOP

2012-11-27 Thread Ray Jones
On 11/27/2012 07:27 PM, Steven D'Aprano wrote: > For something as simple as Least Common Multiple? Using a function is > much more sensible than writing a class. > > OOP is for when you have a single data type that needs *state* and > *behaviour*. A LCM function only has behaviour, and so a func

Re: [Tutor] LCM revisited + OOP

2012-11-27 Thread Steven D'Aprano
On Tue, Nov 27, 2012 at 06:13:52PM -0700, Ray Jones wrote: > Part I > I am a good way through MIT's Introduction to Computer Science and > Programming as offered through edX. I'm not certain I'm going to pass > the course this first time through, the major hangup being the > understanding of OOP.

[Tutor] LCM revisited + OOP

2012-11-27 Thread Ray Jones
Part I I am a good way through MIT's Introduction to Computer Science and Programming as offered through edX. I'm not certain I'm going to pass the course this first time through, the major hangup being the understanding of OOP. Part II When the LCM thread came through, I wrote some quick code do

Re: [Tutor] LCM

2012-11-18 Thread Dave Angel
On 11/18/2012 12:50 PM, Andrew wrote: > On Wed, 14 Nov 2012 19:52:03 +0200, Selby Rowley Cannon > wrote: > >> Hey, >> >> I've been trying to write a function to find the Lowest Common >> Multiple of two numbers, but it isn't working and I've kinda hit a >> dead end on the thought- >> I hav

Re: [Tutor] LCM

2012-11-18 Thread Andrew
On Wed, 14 Nov 2012 19:52:03 +0200, Selby Rowley Cannon wrote: Hey, I've been trying to write a function to find the Lowest Common Multiple of two numbers, but it isn't working and I've kinda hit a dead end on the thought-process end of things. Anyone mind looking at it, and tell

Re: [Tutor] LCM

2012-11-14 Thread eryksun
On Wed, Nov 14, 2012 at 12:52 PM, Selby Rowley Cannon wrote: > > I've been trying to write a function to find the Lowest Common Multiple > of two numbers, but it isn't working and I've kinda hit a dead end on the > thought-process end of things. Since the LCM is the smallest multiple of both

Re: [Tutor] LCM

2012-11-14 Thread Dave Angel
On 11/14/2012 01:34 PM, Selby Rowley Cannon wrote: > On 14/11/12 18:27, Dave Angel wrote: >> On 11/14/2012 12:52 PM, Selby Rowley Cannon wrote: >>> Hey, >>> Tell us what version of Python you're targeting. I'm going to assume 2.x, since you have print without parens. >>> I've been trying to

Re: [Tutor] LCM

2012-11-14 Thread Selby Rowley Cannon
On 14/11/12 18:27, Dave Angel wrote: On 11/14/2012 12:52 PM, Selby Rowley Cannon wrote: Hey, I've been trying to write a function to find the Lowest Common Multiple of two numbers, but it isn't working and I've kinda hit a dead end on the thought-process end of things. Anyone mind looking

Re: [Tutor] LCM

2012-11-14 Thread Dave Angel
On 11/14/2012 12:52 PM, Selby Rowley Cannon wrote: > Hey, > > I've been trying to write a function to find the Lowest Common > Multiple of two numbers, but it isn't working and I've kinda hit a > dead end on the thought-process end of things. Anyone mind looking at > it, and tell me what's wron

[Tutor] LCM

2012-11-14 Thread Selby Rowley Cannon
Hey, I've been trying to write a function to find the Lowest Common Multiple of two numbers, but it isn't working and I've kinda hit a dead end on the thought-process end of things. Anyone mind looking at it, and tell me what's wrong? (I hop you don't think it's too long to put in an emai

Re: [Tutor] LCM

2010-10-21 Thread Alan Gauld
"Jacob Bender" wrote decided to make a program that deals with them. Here's the code: thing = raw_input("What is the first number?\n\n") thing2 = raw_input("What is the second number?\n\n") int(thing) int(thing2) This does nothing useful. It converts the strings to numbers which are immedi

Re: [Tutor] LCM

2010-10-20 Thread Shashwat Anand
On Thu, Oct 21, 2010 at 5:00 AM, Jacob Bender wrote: > Hello all, > > I was wondering if you could please help me with an issue I'm having with > my program. I'm not fond of LCM(Least Common Multiples), and I decided to > make a program that deals with them. Here's the code: > > thing = raw_input

Re: [Tutor] LCM

2010-10-20 Thread christopher . henk
benderjaco...@gmail.com wrote on 10/20/2010 07:30:32 PM: > > thing = raw_input("What is the first number?\n\n") > > thing2 = raw_input("What is the second number?\n\n") > > int(thing) > int(thing2) > The two lines above do the calculation of turning your input strings into int's but d

[Tutor] LCM

2010-10-20 Thread Jacob Bender
Hello all, I was wondering if you could please help me with an issue I'm having with my program. I'm not fond of LCM(Least Common Multiples), and I decided to make a program that deals with them. Here's the code: thing = raw_input("What is the first number?\n\n") thing2 = raw_input("What is