Dec-09-2018, 11:38 PM
The problem is that you are subtracting num from num on line 17, so your look only runs once, not num times. Although if you want a loop to run a certain number of times you should use a for loop:
def show_ast(n): if n > 0: show_ast(n - 1) text = '' for ast in range(n): text += '*' print(text)But with the multiplication of the string that you figured out, you don't need any loop:
def show_ast() if n > 0: show_ast(n - 1) print('*' * n)
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures