Print this using for loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Print this using for loop

. * ** *** ** *

11th Sep 2018, 3:06 AM
Prince Pritam
Prince Pritam - avatar
1 Answer
+ 4
for i in range(-2,3): print(abs(i)*" "+(3-abs(i))*"*")
11th Sep 2018, 3:17 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar