[Tutor] Truckers log Recap
glidedon
glidedon <glidedon@c-zone.net>
Thu, 17 Jan 2002 19:34:28 +0000
Hello kind people,
While trying to implement all your great suggestions, I ran in to a problem.
Please excuse my ignorance :-)
When I replaced this :
# collect user input for first 8 days of record
day1 = input('Enter total hours on duty day1 ?')
day2 = input('Enter total hours on duty day2 ?')
day3 = input('Enter total hours on duty day3 ?')
day4 = input('Enter total hours on duty day4 ?')
day5 = input('Enter total hours on duty day5 ?')
day6 = input('Enter total hours on duty day6 ?')
day7 = input('Enter total hours on duty day7 ?')
day8 = input('Enter total hours on duty day8 ?')
with this :
for i in range( 8 ):
querry_string = " Enter total hours on duty on day%d " % ( i +1 )
input = raw_input(querry_string)
history_list.append( input )
I think the values are stored as strings and not numbers and thus breaks the
rest of the program.
Am I right in this thinking?...and strings are imutable so I can't change
them back to numbers later in the program.. Right ?
Thanks in advance
Don