Friday, 27 September 2013

Simple Python loop counter issue

Simple Python loop counter issue

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/

No comments:

Post a Comment