+0  
 
+1
45
1
avatar+120 

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
Sort: 

1+0 Answers

 #1
avatar+344 
+2

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

 

smileysmileysmiley

 
qualitystreet  May 17, 2018

24 Online Users

avatar
New Privacy Policy (May 2018)
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.  Privacy Policy