[Python] Fireworks : Easy Solution by Python[Python] Fireworks : Easy Solution by Python

🎆

Happy New Year

Week 1, 2026

def fireWorks(num: int): half = num // 2 # Upper Part : for i in range(half): beforeSpaces = i middleSpaces = (half - 1) - i print(' ' * beforeSpaces + '\\' + ' ' * middleSpaces + '|' + ' ' * middleSpaces + '/') # Middle Line : print('-' * num) # Lower Part : for i in range(half - 1, -1, -1): beforeSpaces = i middleSpaces = (half - 1) - i print(' ' * beforeSpaces + '/' + ' ' * middleSpaces + '|' + ' ' * middleSpaces + '\\') num = int(input('Type an odd number : ')) fireWorks(num)