Re: [Tutor] Strange issue output not showing up as floats
On 23/06/14 01:32, Deb Wyatt wrote: In future post real code, real output and real errors. That way we have some chance of helping you. -- I know, i'm sorry. I was avoiding posting the actual > code because it was an assignment, Its even more important for assignments because without real code we will tend to assume you haven't tried to do it. If we can see that you have made a real attempt to solve it then we will help fix the problem. So always post the relevant code. I was really hoping the moderator would see the second > message and not send either message to the group. Unfortunately the second came in just after I'd sent the first... How long does it take to get off of moderation? Until I notice that somebody is cropping up regularly. :-) You are now off moderation. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Strange issue output not showing up as floats
> > Not if you don't show us your code! > > > never mind. I figured it out. I was using %d instead > > of %f in my print statements. duh. > > 'duh', indeed but how could we possibly have helped since > you didn't post any print statements? > > In future post real code, real output and real errors. > That way we have some chance of helping you. > > -- I know, i'm sorry. I was avoiding posting the actual code because it was an assignment, and I did not want this to be construed as cheating. I was just looking for possible ideas of what could possibly be wrong, but not posting the print statement made it impossible for any of you to see my 'duh' error. I was really hoping the moderator would see the second message and not send either message to the group. How long does it take to get off of moderation? Deb in WA, USA FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop! Check it out at http://www.inbox.com/earth ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Strange issue output not showing up as floats
On 21/06/14 00:59, Deb Wyatt wrote: I see you solved it but for future reference... I'm using Python 2.7 for this assignment. input is as follows (not in code order): balance = 4213 annualInterestRate = 0.2 monthlyPaymentRate = 0.04 payment = monthlyPaymentRate * balance balance = balance - payment total_paid = payment Not in code order is bad. We want to see the code - and order matters. output looks like this: Month: 1 Minimum monthly payment: 168 Remaining balance: 4111 You show the output but didn't show us how the output was produced. We had no chance of guessing what you were doing wrong. If you want help you need to help us by showing us the code. Don't guess at what might be wrong. If its less that, say, 100 lines post the real code and post any errors. Would any of you have a clue what could be wrong? Deb in WA, USA Not if you don't show us your code! > never mind. I figured it out. I was using %d instead > of %f in my print statements. duh. 'duh', indeed but how could we possibly have helped since you didn't post any print statements? In future post real code, real output and real errors. That way we have some chance of helping you. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Strange issue output not showing up as floats
On 06/20/2014 07:59 PM, Deb Wyatt wrote: Hello. I hope everyone is having a good day. I am working on an assignment that is supposed to output floats. I'm using floats in the computations and according to Python's rules the output should be floats, but it's not. When I test in Python shell the calculations display correctly, as floats. I'm using Python 2.7 for this assignment. input is as follows (not in code order): balance = 4213 annualInterestRate = 0.2 monthlyPaymentRate = 0.04 payment = monthlyPaymentRate * balance balance = balance - payment total_paid = payment output looks like this: Month: 1 Minimum monthly payment: 168 Remaining balance: 4111 Month: 2 Minimum monthly payment: 164 Remaining balance: 4013 Month: 3 Minimum monthly payment: 160 Remaining balance: 3916 ...etc... Would any of you have a clue what could be wrong? Deb in WA, USA Deb, Can you show us your full code listing or if it is lengthy the relevant section showing the print statement. My guess is your print formating is not specified correctly and it is rounding to the nearest whole number. Jay -- Jay Lozier jsloz...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor