写一段python樱花表白代码
时间: 2023-05-24 15:06:58 浏览: 153
表白小程序:python代码–樱花树(Turtle库)
5星 · 资源好评率100%
import time
def blossom():
for i in range(30,51):
print(" "*30,end="")
print(" * "*i)
time.sleep(0.1)
for i in range(51,60):
print(" "*30,end="")
if i%2==0:
print(" * "*i)
else:
print(" *** "*i)
time.sleep(0.1)
for i in range(60,69):
print(" "*30,end="")
if i%2==0:
print(" *** "*i)
else:
print(" ***** "*i)
time.sleep(0.1)
for i in range(69,77):
print(" "*30,end="")
if i%2==0:
print(" ***** "*i)
else:
print(" ******* "*i)
time.sleep(0.1)
for i in range(77,85):
print(" "*30,end="")
if i%2==0:
print(" ******* "*i)
else:
print(" ********* "*i)
time.sleep(0.1)
for i in range(85,91):
print(" "*30,end="")
if i%2==0:
print(" ********* "*i)
else:
print(" *********** "*i)
for i in range(91,95):
print(" "*30,end="")
print(" *********** "*i)
for i in range(95,97):
print(" "*30,end="")
print(" ************* "*i)
for i in range(97,98):
print(" "*30,end="")
print("*************** "*i)
for i in range(98,99):
print(" "*30,end="")
print("*****************")
#主程序
print("亲爱的XXX:")
time.sleep(1)
print("樱花飘落的季节,我向你表白:")
time.sleep(1)
blossom()
print()
print(" 爱你的YYY")
阅读全文