美文网首页
Python :Happy Mother's Day

Python :Happy Mother's Day

作者: 雅辛托斯之爱 | 来源:发表于2019-05-12 12:12 被阅读0次

import os

import time

from random import randint

for i in range(1, 35):  

    print('')

heartStars = [2,4,8,10,14,20,26,28,40,44,52,60,64,76]  

heartBreakLines = [13, 27, 41, 55, 69, 77]  

flowerBreakLines = [7, 15, 23, 31, 39, 46]

def addSpaces(a)

    count = a

    while count > 0:

        print(' ', end='')

        count -= 1

def newLineWithSleep()

    time.sleep(0.3)

    print('\n', end='')

play = 0

while play == 0:

    Left_Spaces = randint(8, 80)

    addSpaces(Left_Spaces)

    for i in range(0, 78)

        if i in heartBreakLines:

            newLineWithSleep()

            addSpaces(Left_Spaces)

        elif i in heartStars:

            print('*', end='')

        elif i in (32, 36):

            print('M', end='')

        elif i == 34:

            print('O', end='')

        else:

            print(' ', end='')

    newLineWithSleep()

    addSpaces(randint(8, 80))

    print("H a p p y  M o t h e r ' s  D a y !", end='')

    newLineWithSleep()

    newLineWithSleep()

    Left_Spaces = randint(8, 80)

    addSpaces(Left_Spaces)

    for i in range(0, 47)

        if i in flowerBreakLines:

            newLineWithSleep()

            addSpaces(Left_Spaces)

        elif i in (2, 8, 12, 18):

            print('{', end='')

        elif i in (3, 9, 13, 19):

            print('_', end='')

        elif i in (4, 10, 14, 20):

            print('}', end='')

        elif i in (27, 35, 43):

            print('|', end='')

        elif i in (34, 44):

            print('~', end='')

        elif i == 11:

            print('o', end='')

        else:

            print(' ', end='')

    print('\n', end='')  

相关文章

网友评论

      本文标题:Python :Happy Mother's Day

      本文链接:https://www.haomeiwen.com/subject/xrqcaqtx.html