Python Forum

Full Version: Christmas Tree (Why is it like that ?)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,
I'm trying to do a christmas tree but I encouter some problems...


stairs = int(input("Number of stairs for the Christmas Tree :"))
space = " "
star = "*"
stars = " * "
stars_branch = " | "
nbre_line = stairs*4
nbre_line_star = 7
size = nbre_line - 1
nom_ligne = 0
space = " "
def stairs_tree(a) :
    size = nbre_line - 1 - i
    for line in range(5):
        nbre_branch = 2*a * line - 1 
        print(space * size + star * nbre_branch)
        size -= 1
for i in range( stairs +1) :
    stairs_tree(i)
    size = nbre_line -1
And I find this: *
////////***
///////*****
//////*******

////////***
///////*******
//////***********
/////***************

///////*****
//////***********
/////*****************
(don't mind the slash)

Could you please help me remove the space and put it neatly ?
Thanks !
Pls use python tags so we can see the intended indentation.
Is it possible that there is no "space" , but each of your first print lines evaluates to nothing being printed. Hence an apparent "space".

Paul
Sorry it's my first time so I'm a bit lost, where I can put theses "tags" ?
Edit: Wait, nah nervermind sorry.