tree.py 962 Bytes
Newer Older
cmateoioliver's avatar
cmateoioliver committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
import time


def get_small_tree():
    s_tree = "      *      \n" + \
             "     ***     \n" + \
             "    *****    \n" + \
             "   *******   \n" + \
             "  *********  \n" + \
             "      |      \n" + \
             "      |      \n" + "\n"
    return s_tree


def print_medium_tree():
    print("      *      ")
    print("     ***     ")
    print("    *****    ")
    print("   *******   ")
    print("  *********  ")
    print(" *********** ")
    print("*************")
    print("      |      ")
    print("      |      ")
    print("      |      ")
    print("      |      ")
    print("")


i_tree_counts = 1
i_tree_wanted = 5

while i_tree_counts <= i_tree_wanted:
    print("Iteration number:")
    print(i_tree_counts)
    if i_tree_counts > 3:
        print_medium_tree()
    else:
        s_small_tree = get_small_tree()
        print(s_small_tree)
    time.sleep(1)
    i_tree_counts = i_tree_counts + 1