写的代码没有错误但是不运行……

img

用python写的樱花树代码在Visual Studio Code中无法运行是什么情况

你在最后有没有加上如下代码:

T.done()#或者是其它变量,反正是turtle中的done函数

Python的turtle基于tkinter库,done函数相当于tkinter中的mainloop函数,如果没有,窗口是不会显示和启动的。