[Tutor] Is this correct?
oasf2004 at yahoo.com
Sat Apr 15 19:50:29 CEST 2006
This question is regarding the first exercise of the
book "How to think Like a Computer Scientist:
Learning with Python", by Downey, Elkner, and Meyers,
Chapter 13, page 137.
The goal is to write a function printTime that takes a
Time object as an argument and prints it in the form
So, I wrote the script below:
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
print 'The time is %dh:%dmin:%dsec' % (hour, min,
That seems to work, but I would like to hear from you.
Please, let me know if I am in the right way.
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the Tutor