第四周

height

def weightup(weightup):
weight = 70
for i in range(1,11):
weight=weight+weightup
return weight
df=0.5
e=weightup(df)9.8
m=weightup(df)
9.8*0.165
print("你在地球上的重量为{:.3f}.".format(e))
print("你在月球上的重量为{:.3f}.".format(m))

extraDayUP365v6.py

def abilityUP(df):
abilityup=1.0
for i in range(1,366):
if i%7 in [4,5,6,0]:
abilityup=abilityup(df+1)
else:
abilityup =abilityup
1.0
return abilityup
df=0.01
j=abilityUP(df)
print("努力成果:{:.3f}.".format(j))

extraDayUP365v6.py

def abilityUP(df):
abilityup=1.0
for i in range(1,366):
if i%7 in [4,5,6,0]:
abilityup=abilityup(df+1)
elif i%10 in [0]:
abilityup =1.0
else:
abilityup=abilityup
1.0
return abilityup
df=0.01
j=abilityUP(df)
print("努力成果:{:.3f}.".format(j))

判断回文数

x=input("请输入一个数")
if x == x[::-1]:
print("是回文数")
else:
print("不是回文数")

田字格

import turtle
t1=turtle.Turtle()
for i in range(1,12):
t1.forward(20)
t1.penup()
t1.forward(20)
t1.pendown()
t1.penup()
t1.goto(10,210)
t1.pendown()
t1.setheading(-90)
for i in range(1,12):
t1.forward(20)
t1.penup()
t1.forward(20)
t1.pendown()
t1.penup()
t1.goto(210,210)
t1.pendown()
t1.setheading(-90)
for i in range(1,12):
t1.forward(20)
t1.penup()
t1.forward(20)
t1.pendown()
t1.penup()
t1.goto(410,210)
t1.pendown()
t1.setheading(-90)
for i in range(1,12):
t1.forward(20)
t1.penup()
t1.forward(20)
t1.pendown()
t1.penup()
t1.goto(0,200)
t1.pendown()
t1.setheading(0)
for i in range(1,12):
t1.forward(20)
t1.penup()
t1.forward(20)
t1.pendown()
t1.penup()
t1.goto(0,-200)
t1.pendown()
t1.setheading(0)
for i in range(1,12):
t1.forward(20)
t1.penup()
t1.forward(20)
t1.pendown()
turtle.done()

posted @ 2025-03-23 10:54  彭66  阅读(13)  评论(0)    收藏  举报