Python While Loop Exercise ! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

Python While Loop Exercise !

Creating this pattern with the Loops. * ** *** **** ***** ****** ******* ******** ********* ******** ******* ****** ***** **** *** ** *

28th May 2018, 1:21 PM
Adil Shafiq
5 Answers
28th May 2018, 7:19 PM
tamaslud
tamaslud - avatar
+ 4
I prefer For Loops. Saves time and effort count=0 for i in range(10): count+=1 print("*"*count) for i in range(10): count-=1 print("*"*count)
28th May 2018, 1:59 PM
LordHill
LordHill - avatar
28th May 2018, 1:22 PM
Adil Shafiq
0
This is using for loop: p=0 for i in range(10): p+=1 print("*"*p) for i in range(10): p-=1 print("*"*p)
29th May 2018, 5:47 AM
$@|_||\/|¥@
$@|_||\/|¥@ - avatar
0
You are the best Bhai!
5th May 2020, 11:14 AM
Nauman Ali
Nauman Ali - avatar