0

Python Query for drawing pattern

please help me draw this exact pattern in the code. https://code.sololearn.com/c6SK70S0pQ0D/#py

1st Apr 2019, 8:36 AM
Abhay Jindal
Abhay Jindal - avatar
2 odpowiedzi
+ 2
A little modification in your pattern will resolve the problem: pattern=[(("*"*L[i]) + (" "*(1 + 2 * sum(L[0:i])))+ ("*"*L[i])).center(1+2*sum(L)," ") for i in range(0,len(L))]
1st Apr 2019, 10:27 AM
gambler
+ 1
Thanks for the help! But sorry it was my typo error i want my output to be so that no two columns should overlap or in other words if we observe vertically no two stars should overlap!
1st Apr 2019, 11:28 AM
Abhay Jindal
Abhay Jindal - avatar