General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 16th, 2010, 07:06 AM
b1124490 b1124490 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2010
Posts: 1 b1124490 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 50 sec
Reputation Power: 0
Exclamation Help With Python Plz

i donut know what i doing wrong i keep trying different things can any one help me with my program?


#this program counts bottles and tells the payout

#5-4 the bottle rerurn program

#the main function
def main():
endprogram = 'no'
while endprogram == 'no':
totalbottles = getbottles()
totalpayout = calcpayout(totalbottles)
printinfo (totalbottles, totalpayout)
endprogram = raw_input ('do you want to end the program? (enter yes or no): ')

#this function will get the number of bottles returned
def getbottles():
totalbottles = 0
todaybottles = 0
counter = 1
while counter <= 7:
todaybottles = input ('enter number of bottles for today: ')
totalbottles = totalbottles + todaybottles
counter = counter + 1
return totalbottles

#this function will display the information
def printinfo(totalbottles, totalpayout):
print 'the total number of bottles collected was', totalbottles
print 'the total paid out was $', totalpayout

#calls main
main()

i get these errors

Traceback (most recent call last):
File "C:/Documents and Settings/Owner/Desktop/lab5.4.py", line 32, in <module>
main()
File "C:/Documents and Settings/Owner/Desktop/lab5.4.py", line 10, in main
totalbottles = getbottles()
UnboundLocalError: local variable 'getbottles' referenced before assignment

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Help With Python Plz


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap