So basically, a user is prompted to input a number of stairs and a staircase when a guy on it is generated. I know this is sloppy and my variable names are rough, I'm actively working to change them now. I thought I would go ahead and post the working code though.
How can I improve on this? What can I do better to do more with less?
Note: I'm very new to Python and general programming.
def render(num, num3):
num2 = num - 1
white_space7 = ""
white_space = ""
for x in range(num):
white_space = white_space + " "
c = num
white_space5 = makeSpace(Num - num2)
if num3 != 0:
white_space7 = makeFloor(num3)
print(white_space + " *" + white_space5 + "*")
print(white_space + " o *" + white_space5 + "*")
print(white_space + " /|\ *" + white_space5 + "*")
print(white_space + " / \ *" + white_space5 + "*")
print(white_space + "*******" + white_space7 + "*")
else:
print(white_space + " *" + white_space5 + "*")
print(white_space + " o *" + white_space5 + "*")
print(white_space + " /|\ *" + white_space5 + "*")
print(white_space + " / \ *" + white_space5 + "*")
print(white_space + "*******" + white_space7 + white_space5 + "*")
def makeSpace(num):
white_space4 = ""
for x in range(num):
white_space4 = white_space4 + " "
return white_space4
def makeFloor(num):
white_space6 = ""
num4 = num + 1
for x in range(num4):
white_space6 = white_space6 + "*******"
return white_space6
Num = raw_input("Number of Stairs:" )
Num = int(Num)
white_space2 = ""
for x in range(Num + 1):
white_space2 = white_space2 + " "
print(white_space2 + "*******")
y = Num
white_space2 = ""
for x in range(Num):
if (x < Num - 1):
render(y,0)
y -= 1
else:
render(y,Num - 1)
y -= 1