判断自己当前是否是白富美
color=input("你白吗?") #白 或者 黄
money=int(input("请输入你的财产总和:")) #输入1000
beautiful=input("你美么?") #美 或者 普通
# if 白 并且 富 并且 美:
# if 白 and 富 and 美:
if color=="白" and money>1000 and beautiful=="美":
print("白富美..........已经到了人生巅峰")
else:
print("革命尚未成功,仍需努力,人生没有捷径")
import time
time.sleep(15)
制作一个简单的文本进度条:
import time
scale=50
print("执行开始".center(scale//2,"."))
start=time.perf_counter()
for i in range(scale+1):
a='*' * i
b='.' * (scale-i)
c=(i/scale)*100
dur=time.perf_counter()-start
print("\r{:^3.0f}%[{}->{}]{:.2f}s".format(c,a,b,dur),end='')
time.sleep(0.2)
print("\n"+"执行结束".center(scale//2,'.'))
目前水平有限,还写不出高质量的代码,希望继续努力,写出更高质量的代码。