我是Python的初学者,试图编写我的第一个乌龟程序

问题描述 投票:-2回答:1

进口龟

wn = turtle.screen()

alex = turtle.Turtle()

alex.forward(50)

alex.left(90)

alex.forward(30)

wn.mainloop()

traceback
1个回答
0
投票
您收到错误

Traceback (most recent call last): File "</path/to/script>.py", line <number>, in <module> wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen'

因为turtle库没有属性screen,但这只是一个小的错字,因为turtle库

does具有Screen属性。 Python编程语言关心字母的大小写,通常将其描述为区分大小写的语法或case sensitivity

© www.soinside.com 2019 - 2024. All rights reserved.