第一课
#导入海龟绘图模块
import turtle
t = turtle.Pen()
#这是一个循环
for x in range(360):
t.forward(x)
t.left(80)
‘’’
1.刚学习python我很开心
2.生生苦短,相逢何必曾相识
‘’’
4个空格=tab
F5运行代码
#打印
print(“a”)
print(“b”)
print(“c”)
#奥运五环
import turtle
turtle.width(7)
turtle.color(“blue”)
turtle.circle(50)
turtle.penup()
turtle.goto(120,0)
turtle.pendown()
turtle.color(“red”)
turtle.circle(50)
turtle.penup()
turtle.goto(240,0)
turtle.pendown()
turtle.color(“black”)
turtle.circle(50)
turtle.penup()
turtle.goto(60,-50)
turtle.pendown()
turtle.color(“yellow”)
turtle.circle(50)
turtle.penup()
turtle.goto(180,-50)
turtle.pendown()
turtle.color(“green”)
turtle.circle(50)
print()
quit exit 退出
a = 3
sxt = 123
_sxt = 123
3sff
SyntaxError: invalid decimal literal
help
Type help() for interactive help, or help(object) for help about object.
helo()
Traceback (most recent call last):
File “<pyshell#5>”, line 1, in
helo()
NameError: name ‘helo’ is not defined. Did you mean: ‘help’?
help()
help> keywords
Here is a list of the Python keywords. Enter any keyword to get more help.
False class from or
None continue global pass
True def if raise
and del import return
as elif in try
assert else is while
async except lambda with
await finally nonlocal yield
break for not
del 删除
ddd = 0
ddd
0
del ddd
ddd
Traceback (most recent call last):
File “<pyshell#18>”, line 1, in
ddd
NameError: name ‘ddd’ is not defined