我的女神叫包包,今天,我要写个小python向她表达我油腻的爱意。
import time
#示爱关键词
words = 'LoveBaoBao'
print(" ")
print(" ")
print(" 撒浪嘿哟 to 包包 ")
print(" ")
print(" ")
for item in words.split():#要想实现打印出字符间的空格效果,此处添加:item = item+' 'letterlist = []#letterlist是所有打印字符的总list,里面包含y条子列表list_Xfor y in range(12, -12, -1):list_X = []#list_X是X轴上的打印字符列表,里面装着一个String类的lettersletters = ''#letters即为list_X内的字符串,实际是本行要打印的所有字符for x in range(-30, 30):#*是乘法,**是幂次方expression = ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3if expression <= 0:letters += item[(x-y) % len(item)]else:letters += ' 'list_X.append(letters)letterlist += list_Xprint('\n'.join(letterlist))time.sleep(150);