WorksheetsPython L39 US Game 1
Total questions: 10
Worksheet time: 5mins
What is the purpose of the line:
这句代码的目的是什么?
t.ht()
To set the turtle’s heading to zero
将turtle 的航向设置为零
To hide the turtle
为了藏好 turtle
To highlight the turtle
为了让turtle更突出
In the code, what does .penup() do to the turtle?
在代码中,.penup() 对 turtle 做了什么?
stop drawing line
draw more line
Which method reads the 50_States.csv file into a DataFrame?
哪种方法可以将 50_States.csv 文件读取到 DataFrame 中?
pandas.open_csv()
pandas.read_csv()
pandas.load()
pandas.read_file()
填写空白处,将图像添加为海龟形状:
Fill in the blank to add the image as the turtle shape:
screen.__________(image)
addimage
add_image
add_shape
What does this line return?
这行代码返回什么?
state = data[data.state == user_answer]
The DataFrame row(s) where state equals user_answer
DataFrame 中 state 等于 user_answer 的行
The x and y coordinates of the guessed state
guessed state的 x 和 y 坐标
A list of all states except user_answer
除 user_answer 之外的所有states 列表。
An error because state is undefined
因为 state 未定义而导致错误。
If the CSV file is named "50_states.csv" but your code says "50_States.csv", what will happen and why?
如果 CSV 文件名为“50_states.csv”,但你的代码却写成“50_States.csv”,会发生什么情况?为什么?
The code will run successfully without any issues.
代码将成功运行,不会出现任何问题。
The code will fail to find the file due to case sensitivity.
由于区分大小写,代码将无法找到该文件。
The file will be found but will return empty data.
文件会被找到,但会返回空数据。
The code will throw a syntax error unrelated to the file name. 这段代码会抛出一个与文件名无关的语法错误。
Why do we use .item() when getting the x and y coordinates?
为什么在获取 x 和 y 坐标时要使用 .item()?
We use .item() to format the coordinates for display.
我们使用 .item() 来格式化坐标以便显示。
We use .item() to retrieve the actual x and y coordinate values from a data structure.
我们使用 .item() 从数据结构中检测实际的 x 和 y 坐标值。
We use .item() to convert coordinates to strings.
我们使用 .item() 将坐标转换为字符串。
We use .item() to calculate the distance between points.
我们使用 .item() 来计算点之间的距离。
what the meaning of addshape?
Add a custom image or shape for turtle
添加turtle 的自定义图像或形状
Move turtle without drawing a line
移动turtle 而不画线
Display text at the turtle’s location
在turtle 所在位置显示文本
Hide the turtle
藏好 turtle
Complete the code to check if the guessed state is correct: 完成代码以检查猜测的状态是否正确:
if user_answer ____ all_state:
guessed_num += 1
is
not
Fill in the missing part so the turtle writes at the state’s position:
填入缺失部分,使turtle 能够在指定位置书写: t. _____ (state.x.item(), state.Y.item())
