Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 30, 2014, at 4:29 AM, Dave Angel da...@davea.name wrote: You're getting closer. Remember that the assignment shows your function being called with 10, not zero. So you should have a separate local variable, probably called I, which starts at zero, and gets incremented each

Re: [Tutor] while loop

2014-03-31 Thread Mark Lawrence
On 31/03/2014 03:13, Scott Dunning wrote: On Mar 30, 2014, at 4:29 AM, Dave Angel da...@davea.name wrote: You're getting closer. Remember that the assignment shows your function being called with 10, not zero. So you should have a separate local variable, probably called I, which starts

Re: [Tutor] while loop

2014-03-31 Thread Alan Gauld
On 31/03/14 02:37, Scott Dunning wrote: You're getting closer. Remember that the assignment shows your function being called with 10, not zero. So you should have a separate local variable, probably called I, which starts at zero, and gets incremented each time. Without out a break or

Re: [Tutor] while loop

2014-03-31 Thread Alan Gauld
On 31/03/14 03:13, Scott Dunning wrote: separate local variable, probably called I, which starts at zero, and gets incremented each time. The test in the while should be comparing them. So, this is what I have now and it ‘works’ It doesn't work because they are all on the same line. But

Re: [Tutor] while loop

2014-03-31 Thread Dave Angel
Scott Dunning swdunn...@me.com Wrote in message: On Mar 30, 2014, at 4:29 AM, Dave Angel da...@davea.name wrote: You're getting closer. Remember that the assignment shows your function being called with 10, not zero. So you should have a separate local variable, probably called I,

[Tutor] Storing dictionary value, indexed by key, into a variable

2014-03-31 Thread John Aten
Hey all, I am writing a program to drill the user on Latin demonstrative pronouns and adjectives (DPA). It displays a description, and the user has to enter the DPA that corresponds to the description. DPA vary for gender, number and case, and there are 3 separate DPA. I have these stored in a

Re: [Tutor] while loop

2014-03-31 Thread David Rock
* Scott Dunning swdunn...@me.com [2014-03-30 18:37]: Without out a break or placing that 10 in there I can’t think of a way to have the while loop stop once it reaches (n). Any hints? As discussed already, you can't use fixed values (ie, you don't know that 10 is always going to be there).

Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-03-31 Thread Alex Kleider
On 2014-03-31 06:38, John Aten wrote: Hey all, I am writing a program to drill the user on Latin demonstrative pronouns and adjectives (DPA). It displays a description, and the user has to enter the DPA that corresponds to the description. DPA vary for gender, number and case, and there are 3

Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-03-31 Thread Peter Otten
John Aten wrote: Hey all, I am writing a program to drill the user on Latin demonstrative pronouns and adjectives (DPA). It displays a description, and the user has to enter the DPA that corresponds to the description. DPA vary for gender, number and case, and there are 3 separate DPA. I

[Tutor] Fwd: Python bingo game.

2014-03-31 Thread Hardik Gandhi
Hello, Can some one help me with displaying a matrix vertically. For example my output matrix is:- [1 2 5 7 9] [25 67 78 23 34] [33 22 66 88 98] [32 31 41 56 78] [21 34 58 99 76] And i want my matrix to look like this:- [1 25 33 32 21] [2 67 22 31 34] [5 78 66 41 58] [7 23

Re: [Tutor] Fwd: Python bingo game.

2014-03-31 Thread Danny Yoo
Can some one help me with displaying a matrix vertically. For example my output matrix is:- [1 2 5 7 9] [25 67 78 23 34] [33 22 66 88 98] [32 31 41 56 78] [21 34 58 99 76] And i want my matrix to look like this:- [1 25 33 32 21] [2 67 22 31 34] [5 78 66 41 58] [7 23 88 56 99] [9 34

Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-03-31 Thread Danny Yoo
So my question is, why does Python think that D is a string? Assume that Python is telling the truth, at least unless something really unusual is happening. :P Assume D is a string. Your question should really be: why is D a string? Where does D get assigned? --- Also note that in your

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 31, 2014, at 2:01 AM, Alan Gauld alan.ga...@btinternet.com wrote: Incidentally, your assignment does not appear to require a while loop, just iteration? If thats the case you could use a for loop instead and it would actually be more suitable. Have you covered for loops yet? No,

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 31, 2014, at 1:39 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: They say that the truth hurts, so if that's the best you can come up with, I suggest you give up programming :( You’re in the TUTOR section. People in here are new to programming. I’ve only been doing this for a

[Tutor] exercise (while loop)

2014-03-31 Thread Scott W Dunning
I’m working on a few exercises and I’m a little stuck on this one. This is what the book has but it just gives me an endless loop. def square_root(a, eps=1e-6): while True: print x y = (x + a/x) / 2 if abs(y-x) epsilon:

Re: [Tutor] exercise (while loop)

2014-03-31 Thread Danny Yoo
On Mar 31, 2014 6:22 PM, Scott W Dunning scott@cox.net wrote: I’m working on a few exercises and I’m a little stuck on this one. This is what the book has but it just gives me an endless loop. def square_root(a, eps=1e-6): while True: print x y

Re: [Tutor] exercise (while loop)

2014-03-31 Thread Danny Yoo
Also, which book? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] exercise (while loop)

2014-03-31 Thread Danny Yoo
I tweaked it to what I thought was correct but when I test it I get nothing back. def square_root(a, eps=1e-6): x = a/2.0 while True: y = (x + a/x)/2.0 if abs(x - y) eps: return y x = y round(square_root(9)) The way I tweaked it seems to work,

Re: [Tutor] Fwd: Python bingo game.

2014-03-31 Thread Danny Yoo
What difficulty are you having? I need to be straightforward so that you understand, without ambiguity: we do not do your homework. We will not violate the honor code of your institution. To do so is anathema to why folks here volunteer to help beginners. I do want to apologize if the

Re: [Tutor] FASTA parsing, biological sequence analysis

2014-03-31 Thread Danny Yoo
On Tue, Mar 25, 2014 at 8:36 AM, Sydney Shall s.sh...@virginmedia.com wrote: I did not know about biopython, but then I am a debutant. I tried to import biopython and I get the message that the name is unknown. No problem. It is an external library; I hope that you were able to find it! I

Re: [Tutor] exercise (while loop)

2014-03-31 Thread Danny Yoo
On Mon, Mar 31, 2014 at 8:48 PM, Scott W Dunning scott@cox.net wrote: On Mar 31, 2014, at 7:10 PM, Danny Yoo d...@hashcollision.org wrote: Thanks for the info Danny! I’ll try that and I should be able to figure it out with your help! The book I was referring to is greentreepress. The