Q:

Star pattern : 5، write python program to print the following pattern

0

Star pattern 5

    *
   ***
  *****
 *******
*********

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

k = 0
rows = 5
for i in range(1, rows+1):
    for space in range(1, (rows-i)+1):
        print(end="  ")
    while k != (2*i-1):
        print("* ", end="")
        k = k + 1
    k = 0
    print()

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Star pattern : 6، write python program to print t... >>
<< Star pattern : 4، write python program to print t...