Ugh! Programming... - Chicagoland Sportbikes
Chicagoland Sportbikes
 
Open Forum This forum is for all off-topic discussion.

Reply
 
LinkBack Thread Tools Display Modes
post #1 of 66 (permalink) Old 11-04-2010, 01:29 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Ugh! Programming...

Any suggestions?

I have this code in a program called Python, it's running "While" loops, but not returning any value's after prompted for input, just "0's" everything else seems to be working though.....

Here's the code:

#Lab 5-4 The Bottle Return 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:')
todayBottles = totalBottles + todayBottles
counter = counter + 1
return totalBottles

#This function will calculate the payout
def calcPayout(totalBottles):
totalPayout = 0
totalPayout = totalBottles * .10
return totalPayout

#This function will display the information
def printInfo(totalBottles, totalPayout):
print 'The total number of bottles collected is', totalBottles
print 'The total paid out is $', totalPayout

#calls main
main()


Any body familiar enough to understand why I'm not returning a value, the lab specifically outlines setting totalPayout to 0 and totalBottles to 0 and as a variable starting point relying on my looped "Counter"

Figured I'd throw this out there, see what some of you may think? I'm NOT trying to be a programmer and I HATE this course, but gotta do what I gotta do. This is gist of my programming experience nothing more!

Tom
IceCold81 is offline  
Sponsored Links
Advertisement
 
post #2 of 66 (permalink) Old 11-04-2010, 01:41 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by IceCold81 View Post

#Lab 5-4 The Bottle Return 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:')
todayBottles = totalBottles + todayBottles
counter = counter + 1
return totalBottles

#This function will calculate the payout
def calcPayout(totalBottles):
totalPayout = 0
totalPayout = totalBottles * .10
return totalPayout

#This function will display the information
def printInfo(totalBottles, totalPayout):
print 'The total number of bottles collected is', totalBottles
print 'The total paid out is $', totalPayout

#calls main
main()

GOTCHA!

Mutha F#cking programming! So damn tedious!

But I found the issue, stupid typo! ANNOYINNNNNNG!

Tom
IceCold81 is offline  
post #3 of 66 (permalink) Old 11-04-2010, 02:09 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Son of a #$%^$%^&%@#!

I lied! I'm getting my calculated value, but I'm not getting my "printInfo" at the end of my string of 7 for total bottles collected and total paid out! Ugh.... I really can't stand this shit! It takes a certain kind of person to enjoy doing this nonsense!

Tom
IceCold81 is offline  
post #4 of 66 (permalink) Old 11-04-2010, 02:18 PM
Irony helps us play!
 
Arch's Avatar
 
Join Date: Jan 2006
Location: N'ville
Posts: 29,508
Location: N'ville
Sportbike: 2000 F4
Years Riding: Long enough to know better
How you found us: some hot MILF whispered it in my ear
           
You were on the right track in your post #2... You need to keep incrementing totalbottles by todaybottles each time todaybottles is entered. I can't stand python and I'm not sure if you can redefine it on the fly, and this is why I love temp variables...

after the user inputs todaybottles you need to add it to totalbottles and store it off as the new totalbottles variable.

example:

todayBottles = input('Enter number of bottles for today:')
temptotal = totalbottles + todaybottles
totalbottles = temptotal


As it is, you never assign totalbottles to anything EXCEPT 0 earlier in the function.

Everyone Exaggerates

We're being taken for a ride... agaaaaaaain.....


Best Auto/Moto Insurance | Motorcycle Protection Today | FREE Trade-In Quote
Arch is offline  
post #5 of 66 (permalink) Old 11-04-2010, 02:22 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by Arch View Post
You were on the right track in your post #2... You need to keep incrementing totalbottles by todaybottles each time todaybottles is entered. I can't stand python and I'm not sure if you can redefine it on the fly, and this is why I love temp variables...

after the user inputs todaybottles you need to add it to totalbottles and store it off as the new totalbottles variable.

example:

todayBottles = input('Enter number of bottles for today:')
temptotal = totalbottles + todaybottles
totalbottles = temptotal


As it is, you never assign totalbottles to anything EXCEPT 0 earlier in the function.
Yea thats whats confusing as it's lined out in the Lab as setting totalBottles to 0 to be able to assign a starting value and retain the ability to reset the variable.

Tom
IceCold81 is offline  
post #6 of 66 (permalink) Old 11-04-2010, 02:24 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by Arch View Post
You were on the right track in your post #2... You need to keep incrementing totalbottles by todaybottles each time todaybottles is entered. I can't stand python and I'm not sure if you can redefine it on the fly, and this is why I love temp variables...

after the user inputs todaybottles you need to add it to totalbottles and store it off as the new totalbottles variable.

example:

todayBottles = input('Enter number of bottles for today:')
temptotal = totalbottles + todaybottles
totalbottles = temptotal


As it is, you never assign totalbottles to anything EXCEPT 0 earlier in the function.
I like the use of tempTotal though, I gotta try to wrap my head around that.

As of now, I'm not pulling my bottom printInfo AT ALL.

Tom
IceCold81 is offline  
post #7 of 66 (permalink) Old 11-04-2010, 02:25 PM
Registered User
 
Gone In 3's Avatar
 
Join Date: Mar 2009
Location: Texas/Chicago
Posts: 5,771
Location: Texas/Chicago
Sportbike: CBR1000RR
Years Riding: Been around the block with training wheels
How you found us: Folks
           
Hit up TDS. He was bragging about his Python skillz.
Gone In 3 is offline  
post #8 of 66 (permalink) Old 11-04-2010, 02:44 PM
Irony helps us play!
 
Arch's Avatar
 
Join Date: Jan 2006
Location: N'ville
Posts: 29,508
Location: N'ville
Sportbike: 2000 F4
Years Riding: Long enough to know better
How you found us: some hot MILF whispered it in my ear
           
Let's be honest, this is shit code and it looks like functions are being created for the sake of creating them, not because they are really needed. This can be re-done as a simple straight forward single thing with the while loop {though I would use a 'for' loop using each day of the week as the iteration} (...the 'while' in and of itself doesn't really explain that it's 7 because of 7 days of the week; because it just asks the user the same question 7 times and not something specific like asking them for the total on Sunday, Monday, Tuesday, etc).

Everyone Exaggerates

We're being taken for a ride... agaaaaaaain.....


Best Auto/Moto Insurance | Motorcycle Protection Today | FREE Trade-In Quote
Arch is offline  
post #9 of 66 (permalink) Old 11-04-2010, 02:55 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by Arch View Post
Let's be honest, this is shit code and it looks like functions are being created for the sake of creating them, not because they are really needed. This can be re-done as a simple straight forward single thing with the while loop {though I would use a 'for' loop using each day of the week as the iteration} (...the 'while' in and of itself doesn't really explain that it's 7 because of 7 days of the week; because it just asks the user the same question 7 times and not something specific like asking them for the total on Sunday, Monday, Tuesday, etc).
I 100% agree! Shit code indeed! Def just for the sake of creating it! Ugh.. And yea I can't work in the temp variable, because I'd have to define and it works into every level blah! I just want the final printInfo after 7 entries what in the HELL am I missing! My god, I've been F'n with this stupid ass code for over an hour!

And it's asking me after EVERY entry, do I want to end the program, when I don't think it's supposed to, I think it's supposed to run 7 times to acquire a daily total and after 7 tell me the total bottles collected and total paid out, and THEN ask me if I want to end program..... FRUSTRATED!

Tom

Last edited by IceCold81; 11-04-2010 at 02:59 PM.
IceCold81 is offline  
post #10 of 66 (permalink) Old 11-04-2010, 03:06 PM
not well known member....
 
DRMCMTR's Avatar
 
Join Date: Apr 2004
Location: Chicago IL (belmont-cragin)
Posts: 187
Location: Chicago IL (belmont-cragin)
Sportbike: GSXR-600
Years Riding: a few years
How you found us: yahoo
           
Are you getting the "'Do you want to end the program" statement?

Try adding some print/display lines before and after the function calls in the main

print 'before 1 ', totalBottles,totalPayout


totalBottles = getBottles()
print 'before 1 ', totalBottles,totalPayout
totalPayout = calcPayout(totalBottles)
print 'before 2 ', totalBottles,totalPayout
printInfo(totalBottles, totalPayout)
print 'before 3 ', totalBottles,totalPayout
endProgram = raw_input('Do you want to end the program? (enter yes or no): ')

"Carlos"
DRMCMTR is offline  
post #11 of 66 (permalink) Old 11-04-2010, 03:13 PM
 
Join Date: Feb 2005
Location: GL, WI
Posts: 5,356
Location: GL, WI
Sportbike: R6, SV1000s, rm250
Years Riding: since 2001 in socal
How you found us: team chicago
           
Quote:
Originally Posted by Arch View Post
Let's be honest, this is shit code and it looks like functions are being created for the sake of creating them, not because they are really needed. This can be re-done as a simple straight forward single thing with the while loop {though I would use a 'for' loop using each day of the week as the iteration} (...the 'while' in and of itself doesn't really explain that it's 7 because of 7 days of the week; because it just asks the user the same question 7 times and not something specific like asking them for the total on Sunday, Monday, Tuesday, etc).
yup.

i won't lift a finger unless it generates a dollar or someone's at least willing to pay for my "expertise" when it comes to programming. It isn't turn your brain off clean a virus stuff. But why are they trying to train grunts in programming anyway? Are they going to make you take calculus and linear algebra too? or is this just a wet dream? and what's python. Did all the Java beans get used up, and javascript disappear from the Internet? Shoot why not MSQL, that at least english majors have a shot at.
Superspud needs his med's is offline  
post #12 of 66 (permalink) Old 11-04-2010, 03:14 PM
not well known member....
 
DRMCMTR's Avatar
 
Join Date: Apr 2004
Location: Chicago IL (belmont-cragin)
Posts: 187
Location: Chicago IL (belmont-cragin)
Sportbike: GSXR-600
Years Riding: a few years
How you found us: yahoo
           
Does the while loop require an end-while or something like that to mark the end of the loop before "return totalBottles" statement?

"Carlos"
DRMCMTR is offline  
post #13 of 66 (permalink) Old 11-04-2010, 03:15 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by SuperSpud View Post
yup.

i won't lift a finger unless it generates a dollar or someone's at least willing to pay for my "expertise" when it comes to programming. It isn't turn your brain off clean a virus stuff. But why are they trying to train grunts in programming anyway? Are they going to make you take calculus and linear algebra too? or is this just a wet dream? and what's python. Did all the Java beans get used up, and javascript disappear from the Internet? Shoot why not MSQL, that at least english majors have a shot at.
WHAT!?

Tom
IceCold81 is offline  
post #14 of 66 (permalink) Old 11-04-2010, 03:16 PM
Irony helps us play!
 
Arch's Avatar
 
Join Date: Jan 2006
Location: N'ville
Posts: 29,508
Location: N'ville
Sportbike: 2000 F4
Years Riding: Long enough to know better
How you found us: some hot MILF whispered it in my ear
           
Quote:
Originally Posted by DRMCMTR View Post
Does the while loop require an end-while or something like that to mark the end of the loop before "return totalBottles" statement?
I think you just indent the loop underneath it...

The formatting gets lost posting it on clsb...

Everyone Exaggerates

We're being taken for a ride... agaaaaaaain.....


Best Auto/Moto Insurance | Motorcycle Protection Today | FREE Trade-In Quote
Arch is offline  
post #15 of 66 (permalink) Old 11-04-2010, 03:16 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by DRMCMTR View Post
Does the while loop require an end-while or something like that to mark the end of the loop before "return totalBottles" statement?
Potentially, but didn't notice it in the assignment....

Tom
IceCold81 is offline  
post #16 of 66 (permalink) Old 11-04-2010, 03:17 PM
Irony helps us play!
 
Arch's Avatar
 
Join Date: Jan 2006
Location: N'ville
Posts: 29,508
Location: N'ville
Sportbike: 2000 F4
Years Riding: Long enough to know better
How you found us: some hot MILF whispered it in my ear
           
Quote:
Originally Posted by IceCold81 View Post
Potentially, but didn't notice it in the assignment....
The assignment? Is this shit part of some class/instruction ?

Everyone Exaggerates

We're being taken for a ride... agaaaaaaain.....


Best Auto/Moto Insurance | Motorcycle Protection Today | FREE Trade-In Quote
Arch is offline  
post #17 of 66 (permalink) Old 11-04-2010, 03:18 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by Arch View Post
I think you just indent the loop underneath it...

The formatting gets lost posting it on clsb...
Yea the four lines under "While endProgram == 'no:" are indented.

Tom
IceCold81 is offline  
post #18 of 66 (permalink) Old 11-04-2010, 03:18 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by Arch View Post
The assignment? Is this shit part of some class/instruction ?
Yea man, taught by one of the worst instructors EVER!

Tom
IceCold81 is offline  
post #19 of 66 (permalink) Old 11-04-2010, 03:19 PM
Irony helps us play!
 
Arch's Avatar
 
Join Date: Jan 2006
Location: N'ville
Posts: 29,508
Location: N'ville
Sportbike: 2000 F4
Years Riding: Long enough to know better
How you found us: some hot MILF whispered it in my ear
           
Quote:
Originally Posted by IceCold81 View Post
Yea man, taught by one of the worst instructors EVER!
Get your money back.... seriously...

Everyone Exaggerates

We're being taken for a ride... agaaaaaaain.....


Best Auto/Moto Insurance | Motorcycle Protection Today | FREE Trade-In Quote
Arch is offline  
post #20 of 66 (permalink) Old 11-04-2010, 03:23 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by Arch View Post
Get your money back.... seriously...
lol, yea it's ridiculous!

There way of satisfying curriculum requirements and our "Exposure" to programming. My freaking final is to write a program to instruct a robot to multiple tasks ha! Yea we'll see how that goes!

After this class, I don't EVER have to F' with this shit again!

Tom
IceCold81 is offline  
post #21 of 66 (permalink) Old 11-04-2010, 03:29 PM
 
Join Date: Feb 2005
Location: GL, WI
Posts: 5,356
Location: GL, WI
Sportbike: R6, SV1000s, rm250
Years Riding: since 2001 in socal
How you found us: team chicago
           
Quote:
Originally Posted by Arch View Post
Get your money back.... seriously...
no kidding! what kind of self respecting professional, let alone a professor would assign this crap?

shoot do a reporting services 2008 report for me where you are passing a DATE @appVarMEDate prompting for user to input a date, then run a select statement to pull the data from the tables, sort filter and order it quickly and return it to the user in .xls format, html format, pdf format, or csv?

that assignment will get you more places in the real world vs what this guy is having you do.
Superspud needs his med's is offline  
post #22 of 66 (permalink) Old 11-04-2010, 03:31 PM
 
Join Date: Feb 2005
Location: GL, WI
Posts: 5,356
Location: GL, WI
Sportbike: R6, SV1000s, rm250
Years Riding: since 2001 in socal
How you found us: team chicago
           
Quote:
Originally Posted by IceCold81 View Post
lol, yea it's ridiculous!

There way of satisfying curriculum requirements and our "Exposure" to programming. My freaking final is to write a program to instruct a robot to multiple tasks ha! Yea we'll see how that goes!

After this class, I don't EVER have to F' with this shit again!
Are you using RSLogix 5000 and FactoryTalk?

ladder logic programming is relatively easy to get your feet wet in AND is something you can expect from someone with a AA degree.
Superspud needs his med's is offline  
post #23 of 66 (permalink) Old 11-04-2010, 03:35 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by SuperSpud View Post
Are you using RSLogix 5000 and FactoryTalk?

ladder logic programming is relatively easy to get your feet wet in AND is something you can expect from someone with a AA degree.
No to forementioned and is that a dig on the professor or me!?

The course is referred to as "Intro to Computer Programming" I'm sure for a reason haha.

Tom
IceCold81 is offline  
post #24 of 66 (permalink) Old 11-04-2010, 03:36 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
For the record, none of this is helping understand why the hell this isn't working properly!

Ohhh and did I mention after two weeks from now, I could give TWO SHITS about programming! I just need to get through this last week and pass my final by some grace of god!

Tom
IceCold81 is offline  
post #25 of 66 (permalink) Old 11-04-2010, 03:39 PM
 
Join Date: Feb 2005
Location: GL, WI
Posts: 5,356
Location: GL, WI
Sportbike: R6, SV1000s, rm250
Years Riding: since 2001 in socal
How you found us: team chicago
           
get a rock, a paper clip, a staple, a stick of gum, piece of lead from a #2 pencil, some nitroglycerin, dishwashing detergent, toilet bowl cleaner, some aluminum foil, a two liter bottle, and a box of matches.
Superspud needs his med's is offline  
post #26 of 66 (permalink) Old 11-04-2010, 03:40 PM
not well known member....
 
DRMCMTR's Avatar
 
Join Date: Apr 2004
Location: Chicago IL (belmont-cragin)
Posts: 187
Location: Chicago IL (belmont-cragin)
Sportbike: GSXR-600
Years Riding: a few years
How you found us: yahoo
           
Quote:
Originally Posted by IceCold81 View Post
Yea the four lines under "While endProgram == 'no:" are indented.
The return should not be in the loop (only 3 lines indented not four).

Try

while counter <=7:
(indent) todayBottles = input('Enter number of bottles for today:')
(indent) totalBottles = totalBottles + todayBottles
(indent) counter = counter + 1
return totalBottles

"Carlos"

Last edited by DRMCMTR; 11-04-2010 at 03:47 PM.
DRMCMTR is offline  
post #27 of 66 (permalink) Old 11-04-2010, 03:41 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by SuperSpud View Post
get a rock, a paper clip, a staple, a stick of gum, piece of lead from a #2 pencil, some nitroglycerin, dishwashing detergent, toilet bowl cleaner, some aluminum foil, a two liter bottle, and a box of matches.
Tim you are so random today! I take it no suggestions outside of magiver tactics?

Tom
IceCold81 is offline  
post #28 of 66 (permalink) Old 11-04-2010, 03:42 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by DRMCMTR View Post
The return should not be in the loop (only 3 lines idented not four).

Try

while counter <=7:
(indent) todayBottles = input('Enter number of bottles for today:')
(indent) totalBottles = totalBottles + todayBottles
(indent) counter = counter + 1
return totalBottles
I think I've tried this, but hold on, lemme give it a go.....

Tom
IceCold81 is offline  
post #29 of 66 (permalink) Old 11-04-2010, 03:42 PM
 
Join Date: Feb 2005
Location: GL, WI
Posts: 5,356
Location: GL, WI
Sportbike: R6, SV1000s, rm250
Years Riding: since 2001 in socal
How you found us: team chicago
           
Quote:
Originally Posted by IceCold81 View Post
Tim you are so random today! I take it no suggestions outside of magiver tactics?
yeah, i've never touched python, sounds kinda ghey.
Superspud needs his med's is offline  
post #30 of 66 (permalink) Old 11-04-2010, 03:49 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by DRMCMTR View Post
The return should not be in the loop (only 3 lines idented not four).

Try

while counter <=7:
(indent) todayBottles = input('Enter number of bottles for today:')
(indent) totalBottles = totalBottles + todayBottles
(indent) counter = counter + 1
return totalBottles


Bro, you are an absolute ROCKSTAR!!!!! AND P.S. WHY I HATE PROGRAMMING!!!! ALL THIS OVER A SIMPLE INDENT! FML!

Anyway, that was HUGE! Thank you for allowing me to move on with my life! and I owe you a beer sometime or something!

Tom

Last edited by IceCold81; 11-04-2010 at 03:58 PM.
IceCold81 is offline  
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the Chicagoland Sportbikes forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome