- Write down a Python program to:
- Create a 1d array M with values ranging from 2 to 26 and print M.
- Reshape M as a 5×5 matrix and print M.
- Set the value of ęLQQHUĚHOHPHQWVRIWKHPDWUL[0WRDQGSULQW0
- Assign M2 to the M and print M.
- /HWĜVFDOOWKHILUVWURZRIWKHPDWUL[0DYHFWRUY&DOFXODWHWKHPDJQLWXGHRIWKHYHFWRUY and print it.
- Hint:
- Hint: Use np.sqrt()
- Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py)
Expected output:
- Write down a Python program to draw clock with a regular 12-sided polygon (ࢽ12ɽ). A. Set the window title to your student ID and the window size to (480,480).
- Use np.linspace() (or np.arrange()), np.cos(), np.sin() to compute the positions of vertices.
- Use a loop statement to set the positions of all vertices. Do not specify the position by calling glVertex() individually for each vertex.
- The 12 vertices should be specified counterclockwise starting from the vertex on the x-axis.
- (Hint)
- ,IWKHNH\Vđ, Q, W are entered, the time should be changed.
- Hint1: Use a global variable to store which keyboard button was pressed.
- Hint2: Use GL_LINE_LOOP to draw clock, GL_LINES to draw hour hand(ݤ)
- Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py) H. Expected result:



