+0  
 
+1
267
1
avatar+192 

Write a Python program that displays a clock. It should ask the user to input an hour and a minute, and then have the turtle draw a clock face with the hour and minute hands in the correct position.

For example, if the user enters  for the hour and  for the minute, your clock might look like this:



Notice that, since the minute hand is at , the hour hand is three-quarters of the way from  10 to 11.

If the user enters  for the hour and  for the minute, your clock might look like this:



Your clock doesn't have to look exactly like the clock shown above, but your program will be evaluated on whether it precisely draws a clock. The hands should originate from the center of the circle. The 12 and 6 hour tick-mark should be precisely vertically aligned with the center of the circle.

Hint: you might want to use the turtle's  function to draw the twelve tick-marks on the clock.

Please describe the algorithm that you use to draw the clock and to correctly position the hour and minute hands. Also list the inputs you used to test your program.

Maplesnowy  May 17, 2018
 #1
avatar+374 
+2

http://www.101computing.net/python-turtle-clock/

 

smileysmileysmiley

qualitystreet  May 17, 2018

9 Online Users

avatar
avatar

New Privacy Policy

We use cookies to personalise content and advertisements and to analyse access to our website. Furthermore, our partners for online advertising receive information about your use of our website.
For more information: our cookie policy and privacy policy.