+ 1

Stuck on Python Code

Increase and Decrease print()

11th Jun 2019, 1:33 AM
Ryan Garza
5 Answers
+ 3
i = 1 while 1 == 1: print("*" * i) i += 1 if i >= 10: break while 1 == 1: print("*" * i) i -= 1 if i <= 0: break
11th Jun 2019, 2:22 AM
Diego
Diego - avatar
+ 1
i = 1 while 1 == 1: print("*" * 1) i += 1 if i >= 10: break i = 10 while 1 == 1: print("*" * 1) i -= 1 if <= 1: break
11th Jun 2019, 1:38 AM
Ryan Garza
0
I am trying to get * ** *** **** ***** ****** ******* ******** ********* ********** ********* ******** ******* ****** ***** **** *** ** *
11th Jun 2019, 1:40 AM
Ryan Garza
0
I am getting * ********** ********* ******** ******* ****** ***** **** *** ** * On repeat from 10 to 1 decreasing
11th Jun 2019, 1:41 AM
Ryan Garza
0
What am I doing wrong? Your help is greatly appreciated. Thank you.
11th Jun 2019, 1:42 AM
Ryan Garza