Commit ac05eb5a by BellCodeEditor

auto save

parent c593e827
Showing with 46 additions and 10 deletions
# 勇于挑战的创造师,请运行这段代码,看看能不能将颜良、文丑加入战场?
a= ['华雄']
a.append('颜良','文丑')
print(a)
num1 = int(input())
num2 = int(input())
res = ""
for i in range(num1,num2+1):
if i % 7 == 0 and i % 5 !=0:
#拼接结果
res=res+str(i)+','
if res != "":
# 去掉末尾的冒号
print(res[0:-1])
# 勇于挑战的创造师,请运行下面的代码,观察运行结果,和小伙伴们说说你的发现?
a= ['华雄']
c=['颜良','文丑']
a.extend(c)
print(a)
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.speed(0)
# pen.hideturtle()
pen.pencolor("red")
pen.circle(120)
#总共画12个菱形
for i in range(12):
pen.pencolor("yellow")
pen.fillcolor("yellow")
pen.begin_fill()
pen.right(120)
pen.forward(80)
pen.left(60)
pen.forward(80)
pen.left(120)
pen.forward(80)
pen.left(60)
pen.forward(80)
pen.end_fill()
#设置圆弧为红色
pen.pencolor("red")
#让笔头的位置还原
pen.right(120)
#让菱形在在圆弧上旋转30度(360/12)
pen.circle(120,30)
turtle.done()
letter = "a"
if "a"<= letter <= "z":
print("letter存在a-z中")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment