python for 循环打印心形
import time
sentence = “Dear, I love you forever!”
for char in sentence.split():
allChar = []
for y in range(12, -12, -1):
lst = []
lst_con = ‘’
for x in range(-30, 30):
formula = ((x0.05)**2+(y0.1)**2-1)**3-(x0.05)*2(y0.1)**3
if formula <= 0:
lst_con += char[(x) % len(char)]
else:
lst_con += ’ ’
lst.append(lst_con)
allChar += lst
print(’\n’.join(allChar))
time.sleep(1)
作者:su_bao
来源:CSDN
原文:https://blog.csdn.net/su_bao/article/details/80355001
版权声明:本文为博主原创文章,转载请附上博文链接!
此案例是参考而来,为借鉴学习