Re: Python 2.7.6 help with modules

2014-02-09 Thread Scott W Dunning
On Feb 8, 2014, at 11:30 PM, Chris Angelico ros...@gmail.com wrote: I have one more question on this if you don’t mind. I’m a bit confused on how it works this way without it being in seconds? I’ll answer below each step of how it seems to work to me. How to do it from the small end up:

Re: Python 2.7.6 help with modules

2014-02-09 Thread Scott W Dunning
On Feb 8, 2014, at 11:30 PM, Chris Angelico ros...@gmail.com wrote: OH, I think I figured it out. time = int(raw_input(Enter number of seconds: “)) 100 seconds = time % 60 Remainder of 40 - for seconds. time /= 60 Here you take 100/60 = 1 (which = time for the next line).

Re: Python 2.7.6 help with modules

2014-02-09 Thread Chris Angelico
On Mon, Feb 10, 2014 at 3:17 PM, Scott W Dunning swdunn...@cox.net wrote: How to do it from the small end up: time = int(raw_input(Enter number of seconds: )) seconds = time % 60 So here it takes say 100 and divides it by 60 to put in seconds and spits out the remainder? 100 / 60

Re: Python 2.7.6 help with modules

2014-02-09 Thread Chris Angelico
On Mon, Feb 10, 2014 at 3:31 PM, Scott W Dunning swdunn...@cox.net wrote: I guess I answered my own question and it looks like it wouldn’t matter if you did it opposite from weeks to seconds. Yep, you've got it! Remember, you can always try things out in the interactive interpreter to see

Re: Python 2.7.6 help with modules

2014-02-08 Thread Chris Angelico
On Sun, Feb 9, 2014 at 11:28 AM, Scott W Dunning swdunn...@cox.net wrote: So, this is more like what you’re talking about? first = number / 10 second = number % 10 last = first %10 rest = second / 10 I feel stupid saying this and it’s probably because of the variables I’m using but I’m

Re: Python 2.7.6 help with modules

2014-02-08 Thread Scott W Dunning
On Feb 8, 2014, at 5:56 PM, Chris Angelico ros...@gmail.com wrote: Carry on with that method - work out the number of minutes, and then the hours_etc which has the rest. Then do the same to split off hours, and then days. See how you go! I did it similar to that but I went backwards. I

Re: Python 2.7.6 help with modules

2014-02-08 Thread Chris Angelico
On Sun, Feb 9, 2014 at 12:21 PM, Scott W Dunning swdunn...@cox.net wrote: I figured it out! Thanks Chris! Taking it one step at a time with the five digit number really helped me to see how to break it all up! Are you a teacher? I appreciate the help and the patients! I like that you

Re: Python 2.7.6 help with modules

2014-02-08 Thread Chris Angelico
On Sun, Feb 9, 2014 at 12:46 PM, Scott W Dunning swdunn...@cox.net wrote: On Feb 8, 2014, at 5:56 PM, Chris Angelico ros...@gmail.com wrote: Carry on with that method - work out the number of minutes, and then the hours_etc which has the rest. Then do the same to split off hours, and then

Re: Python 2.7.6 help with modules

2014-02-08 Thread Scott W Dunning
I figured it out! Thanks Chris! Taking it one step at a time with the five digit number really helped me to see how to break it all up! Are you a teacher? I appreciate the help and the patients! I like that you don’t just give me the answer that you break it down and help me so that I can

Re: Python 2.7.6 help with modules

2014-02-08 Thread Scott W Dunning
On Feb 7, 2014, at 11:29 PM, Chris Angelico ros...@gmail.com wrote Close! But if you print out foo and bar, you'll see that you're naming them backwards in the second one. The last digit is the remainder (modulo), the rest is the quotient. So, this is more like what you’re talking about?

Re: Python 2.7.6 help with modules

2014-02-08 Thread Scott W Dunning
On Feb 8, 2014, at 6:46 PM, Chris Angelico ros...@gmail.com wrote: No, I'm not a teacher by profession, but I was homeschooled, and since I'm the second of seven children [1], I got used to teaching things to my siblings. Also, every week I run a Dungeons and Dragons campaign online, which

Re: Python 2.7.6 help with modules

2014-02-08 Thread Chris Angelico
On Sun, Feb 9, 2014 at 1:07 PM, Scott W Dunning swdunn...@cox.net wrote: On Feb 8, 2014, at 6:46 PM, Chris Angelico ros...@gmail.com wrote: I had no idea that, in a group of half a dozen nerds, nobody would recognize this broken text: In brightest day, in blackest night / No evil ..

Re: Python 2.7.6 help with modules

2014-02-08 Thread Scott W Dunning
On Feb 8, 2014, at 6:46 PM, Chris Angelico ros...@gmail.com wrote: That's certainly effective. It's going to give you the right result. I would be inclined to start from the small end and strip off the seconds first, then the minutes, etc, because then you're working with smaller divisors

Re: Python 2.7.6 help with modules

2014-02-08 Thread Chris Angelico
On Sun, Feb 9, 2014 at 5:00 PM, Scott W Dunning swdunn...@cox.net wrote: On Feb 8, 2014, at 6:46 PM, Chris Angelico ros...@gmail.com wrote: That's certainly effective. It's going to give you the right result. I would be inclined to start from the small end and strip off the seconds first,

Re: Python 2.7.6 help with modules

2014-02-08 Thread Larry Hudson
On 02/08/2014 05:21 PM, Scott W Dunning wrote: I figured it out! Thanks Chris! Taking it one step at a time with the five digit number really helped me to see how to break it all up! Are you a teacher? I appreciate the help and the patients! I like that you don’t just give me the answer

Python 2.7.6 help with modules

2014-02-07 Thread Scott W Dunning
I have a question that was a part of my homework and I got it correct but the teacher urged me to do it using the % sign rather than subtracting everything, for some reason I’m having issues getting it to calculate correctly. I’ll put the question below, and what I originally had and below

Re: Python 2.7.6 help with modules

2014-02-07 Thread Rustom Mody
On Saturday, February 8, 2014 10:14:10 AM UTC+5:30, Scott W Dunning wrote: I have a question that was a part of my homework and I got it correct but the teacher urged me to do it using the % sign rather than subtracting everything, for some reason I'm having issues getting it to calculate

Re: Python 2.7.6 help with modules

2014-02-07 Thread Chris Angelico
On Sat, Feb 8, 2014 at 3:44 PM, Scott W Dunning swdunn...@cox.net wrote: - This is what I’ve been working with. I get the correct answers for minutes and seconds then it goes to shit after that. seconds = raw_input(Enter the number of seconds:) seconds = int(seconds) minutes = seconds/60

Re: Python 2.7.6 help with modules

2014-02-07 Thread Chris Angelico
On Sat, Feb 8, 2014 at 3:44 PM, Scott W Dunning swdunn...@cox.net wrote: I have a question that was a part of my homework and I got it correct but the teacher urged me to do it using the % sign rather than subtracting everything, for some reason I’m having issues getting it to calculate

Re: Python 2.7.6 help with modules

2014-02-07 Thread Asaf Las
On Saturday, February 8, 2014 7:05:49 AM UTC+2, Rustom Mody wrote: On Saturday, February 8, 2014 10:14:10 AM UTC+5:30, Scott W Dunning wrote: I have a question that was a part of my homework and I got it correct but the teacher urged me to do it using the % sign rather than subtracting

Re: Python 2.7.6 help with modules

2014-02-07 Thread Scott W Dunning
On Feb 7, 2014, at 10:10 PM, Chris Angelico ros...@gmail.com wrote: It might be easiest to think in terms of a single divide into quotient and remainder operation. Let's leave aside weeks/days/hours/minutes/seconds and split a number up into its digits. (This is actually not as useless as

Re: Python 2.7.6 help with modules

2014-02-07 Thread Rustom Mody
On Saturday, February 8, 2014 10:35:49 AM UTC+5:30, Rustom Mody wrote: On Saturday, February 8, 2014 10:14:10 AM UTC+5:30, Scott W Dunning wrote: I have a question that was a part of my homework and I got it correct but the teacher urged me to do it using the % sign rather than subtracting

Re: Python 2.7.6 help with modules

2014-02-07 Thread Chris Angelico
On Sat, Feb 8, 2014 at 4:53 PM, Scott W Dunning swdunn...@cox.net wrote: So, if I use the five digit # 5, bar = 5000, and foo = 0 because there is no remainder after dividing by 10? Does it make a difference weather foo or bar are written first? That's correct. It'll be more visible if

Re: Python 2.7.6 help with modules

2014-02-07 Thread Scott W Dunning
On Feb 7, 2014, at 10:10 PM, Chris Angelico ros...@gmail.com wrote: You should be able to get this to the point of writing out five separate values, which are the original five digits. Each one is worth 10 of the previous value. At every step, do both halves of the division. What do you

Re: Python 2.7.6 help with modules

2014-02-07 Thread Chris Angelico
On Sat, Feb 8, 2014 at 4:55 PM, Scott W Dunning swdunn...@cox.net wrote: On Feb 7, 2014, at 10:10 PM, Chris Angelico ros...@gmail.com wrote: You should be able to get this to the point of writing out five separate values, which are the original five digits. Each one is worth 10 of the

Re: Python 2.7.6 help with modules

2014-02-07 Thread Scott W Dunning
On Feb 7, 2014, at 10:10 PM, Chris Angelico ros...@gmail.com wrote: number = int(raw_input(Enter a five-digit number: )) Now we begin to split it up: foo = number % 10 bar = number / 10 Ok, so it this what you’re talking about? number = int(raw_input(“Enter a five digit number:))

Re: Python 2.7.6 help with modules

2014-02-07 Thread Chris Angelico
On Sat, Feb 8, 2014 at 5:27 PM, Scott W Dunning swdunn...@cox.net wrote: Ok, so it this what you’re talking about? number = int(raw_input(“Enter a five digit number:)) foo = number % 10 bar = number / 10 digit = foo / 10 rem = bar % 10 Close! But if you print out foo and bar, you'll see