loops

Run Settings
LanguagePython
Language Version
Run Command
def christmas_tree(height): for i in range(height): print(("*" * (i * 2 + 1)).center(height * 2 - 1)) # Tree Trunk for _ in range(height // 3): # Print trunk (centered, width of 3 stars, can be adjusted) print(("|" * 3).center(height * 2 - 1)) # Set the desired height of the tree (e.g., 5 levels) christmas_tree(5)
Editor Settings
Theme
Key bindings
Full width
Lines