Hoffmann wrote:
> So, I wrote the script below:
> 
> class Time:
>       pass
>       
> hour = int( raw_input('Enter the hour: ') )
> min = int( raw_input('Enter the minute: ') )
> sec = int( raw_input('Enter the sec: ') )
> 
> time = Time()
> time.hours = hour
> time.minutes = min
> time.seconds = sec
> 
> def printTime(time):
>       print 'The time is %dh:%dmin:%dsec' % (hour, min,
> sec)

You fixed this in your later version, but here you are not using the 
hour, min, sec attributes from time, you are using the global hour, min, 
sec from the raw_input() calls. It should be time.hour, etc.

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to