[Tutor] Beautiful Soup

2015-12-12 Thread Crusier
Dear All, I am trying to scrap the following website, however, I have encountered some problems. As you can see, I am not really familiar with regex and I hope you can give me some pointers to how to solve this problem. I hope I can download all the transaction data into the database. However, I

Re: [Tutor] Tutor Digest, Vol 142, Issue 10

2015-12-12 Thread Ken Hammer
I have a more simple-minded solution. The error appears to occur in testing without revealing the problem by use of $1 base price in the test. Using $10,000 as the base price in the test reveals absurd numbers. I think the real problem lies in the inclusion of base price inappropriately, twi

Re: [Tutor] Calculation error with a simple program

2015-12-12 Thread Todd Purple via Tutor
> On Dec 12, 2015, at 2:03 AM, Jim Gallaher wrote: > > Hi everyone. I'm reading through a beginners Python book and came up with a > super simple program. I'm not getting any errors and everything runs through, > but there's a logical calculation error. What the program does is take an > amo

Re: [Tutor] Calculation error with a simple program

2015-12-12 Thread Jim Gallaher
Hi Alan, I'm 100 percent sure I'm wrong. :-) I verified it when I fixed the mistake. The problem was it was adding in the basePrice and the fixed rates/percentages each time. So I figured it out when Ian said something about that. Thanks for everyone's help! :-)

Re: [Tutor] Calculation error with a simple program

2015-12-12 Thread Steven D'Aprano
On Sat, Dec 12, 2015 at 01:03:05AM -0600, Jim Gallaher wrote: > Hi everyone. I'm reading through a beginners Python book and came up > with a super simple program. I'm not getting any errors and everything > runs through, but there's a logical calculation error. What the program > does is take a

Re: [Tutor] Calculation error with a simple program

2015-12-12 Thread Laura Creighton
I haven't verified this, but you are probably up against some problem caused by using floating point to store money. The problem is that, when people see something like the floating point number, 3.15 they think, aha, this is a decimal number just like I learned in school when I was 10 years old.

Re: [Tutor] Calculation error with a simple program

2015-12-12 Thread Alan Gauld
On 12/12/15 07:03, Jim Gallaher wrote: > For example, if I put in a value of 1, it will output 752.12 as the sub > total and 753.12 as the grand total. It's off by 1 on sub total and 2 on > grand total. Are you sure? Lets check the values... > basePrice = int(input("Please enter in the price o

[Tutor] Calculation error with a simple program

2015-12-12 Thread Jim Gallaher
Hi everyone. I'm reading through a beginners Python book and came up with a super simple program. I'm not getting any errors and everything runs through, but there's a logical calculation error. What the program does is take an amount and calculate a couple percentages and add a couple fees.