import turtle screen = turtle.Screen() width, height = screen.screensize() print("Width =", width) print("Height =", height)
Width = 400 Height = 300
import turtle screen = turtle.Screen() screen.setup(width=800, height=600)Output: A new canvas window will appear with the specified dimensions of width=800 and height=600. In both examples, `turtle` is the package library used.