CPSC120
Fundamentals of Computer Science

In-class Activity 12

  1. Random Dot

    Create a Python program that draws a small dot at a random location in the window. Use the dot function to draw the dot and the window_height and window_width functions to get the dimensions of the window. Use the random module to generate the random location of the dot.

  2. Distance

    Create a Python program that draws a small dot at a random location in the window and also calculates and draws the distance from the center of the window to the dot. Use the write function to draw text to the window.