Leading Hand (2) X92169


Statement
 

pdf   zip

Write a function @leading_hand(h, m)@ that given integers 0h<240 \le h < 24 and 0m<600 \le m < 60 representing a digital hour returns the leading hand of an analogical watch pointing out that hour. Depending on value parameters the function returns either the string "hour hand", "minute hand" or "draw". Leading hand is the one closest to 1212 following the clockwise rotation. We assume hour hand has only 1212 possible configurations and minute hand has 6060.

Sample session

Sample session
>>> leading_hand(22, 51)
'minute hand'
>>> leading_hand(21, 45)
'draw'
>>> leading_hand(6, 28)
'hour hand'
>>> leading_hand(4, 20)
'draw'
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python