Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def c_tree(x, y, message, fill_sign='#', space_sign=' '):
- print('{}{}'.format(' ' * ((2 * x - len(message)) // 2), message + '\n'))
- for i in range(x):
- space = space_sign * (x - i)
- fill = fill_sign * (i * 2)
- print(f'{space}{fill}{space}')
- for _ in range(y):
- space = space_sign * (x-1)
- print('{}{}{}'.format(space, fill_sign*2, space))
- c_tree(10, 3, 'Frohe Weihnachten', fill_sign='=', space_sign='#')
- Frohe Weihnachten
- ####################
- #########==#########
- ########====########
- #######======#######
- ######========######
- #####==========#####
- ####============####
- ###==============###
- ##================##
- #==================#
- #########==#########
- #########==#########
- #########==#########
- c_tree(10, 3, 'Frohe Weihnachten', fill_sign='=', space_sign=' ')
- Frohe Weihnachten
- ==
- ====
- ======
- ========
- ==========
- ============
- ==============
- ================
- ==================
- ==
- ==
- ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement