Ok, I am trying to make a simple program to kinda test how well i am learning things, I have come to a point where it is getting very large as I want the program to store data in sections (Day1,Day2....ect) so i tried to assign it to read the current Day count (Num_Days = ) but it doesnt seem to like this. I made a small test loop to try and test out if i could do this and have gotten stuck even though the logic looks good to me. I tried to do some searches but as i dont know what I am trying to do is even called I havent gotten very far. What I want to do is have the loop read the Num_Days and give the Days() the count and assign it to that day through 'n'.
Num_Days = 0
Total = 0
Data = 0
Day1 = 0
Day2 = 0
Day3 = 0
def Start_Work(x):
while Num_Days < 3:
Num_Days += 1
print "This is Day:",Num_Days
n = Num_Days
Total = +20
Day(n) += Total
else:
print "failed"
x = str('start')
I also made a dpaste on it as it is easier for me to look at it that way then in the full black: http://dpaste.com/1398446/
In order to clear up apparently where I lost some people with thinking that I am just trying to make a single loop that sits by its self I am going to put up what I am trying to use this for. This program is functioning the way I have wanted it to, the problem being that if i wanted o make it bigger it would get to be very long.
NumDays = 0
TotalOut = 0
Day1Tot = 0
Day1_RepsCnt = 0
Day4 = 0
def Work_Out(x):
while x == 1: ##crunches
NumDays = 0
TotalOut = 0
Day1Tot = 0
Day1_RepsCnt = 0
Day1_WghtCnt = 0
Day4 = 0
while NumDays < 3:
Day1_Wght = float(raw_input("How much weight did you use?"))
Day1_Reps = float(raw_input("How many reps did you do?"))
Day1_Sets = float(raw_input("How many sets were done?"))
Day1 = Day1_Wght * Day1_Reps * Day1_Sets
NumDays += 1
print "Day:",NumDays
print "Your total output is:",Day1
Day1_RepsCnt += Day1_Reps
Day1_WghtCnt += Day1_Wght
Day1Tot += Day1
TotalOut += Day1
if NumDays == 3:
print "Your total output for 3 days is:",TotalOut
print "Lets increase the Weight to",(Day1_Wght + 10)
print "Increase the Weight for days 4-6"
while NumDays >= 3 and NumDays <6:
Day4_Wght = float(raw_input("How much weight did you use?"))
if Day4_Wght <= (Day1_WghtCnt/3):
print "You need to increase your total output, add 10 pounds."
break
Day4_Reps = float(raw_input("How many reps did you do?"))
Day4_Sets = float(raw_input("How many sets were done?"))
Day4 += Day4_Wght * Day4_Reps * Day4_Sets
NumDays += 1
print "Day:",NumDays
if Day4_Wght <= (Day1_WghtCnt/3):
print "Re-enter totals once you have added the additional weight."
else :
print "Your total output was:",Day4
while x == 2: ##Benching
NumDays = 0
TotalOut = 0
Day1Tot = 0
Day1_RepsCnt = 0
Day4 = 0
while NumDays < 3:
Day1_Wght = float(raw_input("How much weight did you use?"))
Day1_Reps = float(raw_input("How many reps did you do?"))
Day1_Sets = float(raw_input("How many sets were done?"))
Day1 = Day1_Wght * Day1_Reps * Day1_Sets
NumDays += 1
print "Day:",NumDays
print "Your total output is:",Day1
Day1_RepsCnt += Day1_Reps
Day1Tot += Day1
TotalOut += Day1
if NumDays == 3:
print "Your total output for 3 days is:",TotalOut
print "Lets increase the Reps to",(Day1_Reps + 10)
print "Increase reps for days 4-6"
while NumDays >= 3 and NumDays <6:
Day4_Wght = float(raw_input("How much weight did you use?"))
Day4_Reps = float(raw_input("How many reps did you do?"))
if Day4_Reps <= (Day1_RepsCnt/3):
print "You need to increase your total output, do 10 more Reps."
break
Day4_Sets = float(raw_input("How many sets were done?"))
Day4 += Day4_Wght * Day4_Reps * Day4_Sets
NumDays += 1
print "Day:",NumDays
if Day4_Reps <= (Day1_RepsCnt/3):
print "Re-enter totals once you have completed the additional reps."
else :
print "Your total output was:",Day4
print "Available work outs in this version: crunches, benching"
Input = raw_input("What type of Work Out did you do?")
if Input.lower() == str('crunches'):
Work_Out(1)
if Input.lower() == str('benching'):
Work_Out(2)
else:
print "Failed"
And yes I understand that this needs to be cleaned up, but I have other ideas of what i want to throw in there and things i want to rearrange, but right now its just trying to figure out how I can break this into weekly cycles, and break each week into daily cycles, so i started with trying to get through one week and figure out that it would be very difficult just trying to get past 2 days so i broke it into 2 parts instead of 6 days. Any advise is welcome.