Re: [Tutor] Issue with Python

2014-11-13 Thread Steven D'Aprano
On Fri, Nov 14, 2014 at 10:07:08AM +1100, Daniel Williams wrote: > Hi, I'm dw0391 > I have an issue with a class task that my teacher can't seem to fix. Oooh, that's sad that your teacher can't fix this. Jumping ahead to the relevant part of the code, I can see two errors with the same line of c

Re: [Tutor] Issue with Python

2014-11-13 Thread Alan Gauld
On 13/11/14 23:07, Daniel Williams wrote: Hi, I'm dw0391 I have an issue with a class task that my teacher can't seem to fix. Please explain what the issue is, don;t make us guess. And don't expect us to run code that you acknowledge is buggy! We were asked to write the code for a 'no interes

[Tutor] Issue with Python

2014-11-13 Thread Daniel Williams
Hi, I'm dw0391 I have an issue with a class task that my teacher can't seem to fix. We were asked to write the code for a 'no interest loan repayment calculator'. I tried, but it did not work. Attached is the relevant file, 'Prog 6' Could you please tell me what I am doing wrong? Thanks. # No Inter

Re: [Tutor] “has a value of True” versus “evaluates true”

2014-11-13 Thread Steven D'Aprano
On Thu, Nov 13, 2014 at 12:16:19PM -0800, Danny Yoo wrote: > > Unlike some languages, which choose confusing and arbitrary sets of > > values that count as truthy or falsey, Python encourages a simple > > distinction, something versus nothing. Values which represent some kind > > of "nothing" are f

Re: [Tutor] don't understand iteration

2014-11-13 Thread Steven D'Aprano
On Mon, Nov 10, 2014 at 03:08:23PM -0800, Clayton Kirkwood wrote: > Also of confusion, the library reference says: > > Match objects always have a boolean value of True. Since match() and > search() return None when there is no match, you can test whether there was > a match with a simple if stat

Re: [Tutor] “has a value of True” versus “evaluates true”

2014-11-13 Thread Marc Tompkins
On Thu, Nov 13, 2014 at 12:40 PM, Ben Finney wrote: > Danny Yoo writes: > > > >> To quote: "Let your statement be: 'Yes, yes', or "no, no': anything > > >> beyond these is of evil." > > > > > > "Have you stopped abusing small children yet?" > > > > :( > > > > I don't understand what your respons

Re: [Tutor] “has a value of True” versus “evaluates true”

2014-11-13 Thread Ben Finney
Danny Yoo writes: > >> To quote: "Let your statement be: 'Yes, yes', or "no, no': anything > >> beyond these is of evil." > > > > "Have you stopped abusing small children yet?" > > :( > > I don't understand what your response here means. He's pointing out that many questions that ask a yes-or-no

Re: [Tutor] “has a value of True” versus “evaluates true”

2014-11-13 Thread Danny Yoo
> Unlike some languages, which choose confusing and arbitrary sets of > values that count as truthy or falsey, Python encourages a simple > distinction, something versus nothing. Values which represent some kind > of "nothing" are falsey: Hi Steven, Sure. I'm not arguing that Python's choices o

Re: [Tutor] don't understand iteration

2014-11-13 Thread Steven D'Aprano
Coming in late to the conversation: On Sun, Nov 09, 2014 at 04:34:29PM -0800, Clayton Kirkwood wrote: > I have the following code: > > import urllib.request,re,string > months = ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', > 'Sep.', 'Oct.', 'Nov.', 'Dec.'] > from urllib.reque