简单Python-3程序中的无效语法错误
第7行中的问题: 画一个圆圈(乌龟,右): 编译器只告诉我有语法错误,并在 那条线的尽头。简单Python-3程序中的无效语法错误,python,syntax,python-3.x,syntax-error,Python,Syntax,Python 3.x,Syntax Error,第7行中的问题: 画一个圆圈(乌龟,右): 编译器只告诉我有语法错误,并在 那条线的尽头。 我确信我遗漏了一些简单的东西,但是代码看起来很正确。在python中,我们使用def关键字定义函数。。像 from TurtleWorld import * import math bob = Turtle() print(bob) draw_circle(turtle, r): d = r*2 c = d*math.pi degrees = 360/25 length
我确信我遗漏了一些简单的东西,但是代码看起来很正确。在python中,我们使用
def
关键字定义函数。。像
from TurtleWorld import *
import math
bob = Turtle()
print(bob)
draw_circle(turtle, r):
d = r*2
c = d*math.pi
degrees = 360/25
length = c // 25
for i in range(25):
fd(turtle, length)
rt(turtle, degrees)
draw_circle(bob, 25)
wait_for_user()
在python中,我们使用
def
关键字定义函数。。像
from TurtleWorld import *
import math
bob = Turtle()
print(bob)
draw_circle(turtle, r):
d = r*2
c = d*math.pi
degrees = 360/25
length = c // 25
for i in range(25):
fd(turtle, length)
rt(turtle, degrees)
draw_circle(bob, 25)
wait_for_user()
你需要写:
def draw_circle(turtle, r):
# ...
到。您需要写:
def draw_circle(turtle, r):
# ...
到。
您缺少def部件吗?
您缺少def部分吗?我想,如果其他三个答案不够明显,我应该告诉您首先需要def
def draw_circle(turtle, r):
@复制人:
说真的,我们能再得到一个答案吗?我相信3(如果你加上我,4)是不够的我想,万一其他三个答案不够明显,我应该告诉你,你首先需要def
def draw_circle(turtle, r):
@复制人:
说真的,我们能再得到一个答案吗?我认为3(如果你加上我,4)是不够的