Python Pattern Programs - Printing Stars '*' in Right Angle Triangle Shape

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024
  • In this Python Pattern Printing Programs video tutorial you will learn to print star '*' in right angle triangle shape.
    To print star pyramid patterns in python you have to use two for loops. Program that prints pattern contains two for loops: the first loop is responsible for rows and the second for loop is responsible for columns.Here we want odd number of star in columns so we used one extra variable k.
    If you are using Python 2 then if you write this code you will get error because in python 2 print is not a function and also we cant use end there so you need to use print as statement and instead of end you need to use coma (,) at the end of print statement to get the same output.
    in python 3 you write print like this:
    print("*',end="")
    in python 2 you need to write:
    print "*",
    For more free tutorials on computer programming
    / amulsacademy
    AmulsAcademy

ความคิดเห็น • 171

  • @skrishnan9625
    @skrishnan9625 3 ปีที่แล้ว +39

    n=int(input("Enter the number of rows"))
    for i in range(n):
    for j in range(2*i+1):
    print("*",end=" ")
    print()
    This is easier than keeping k=1 and every time appending its value by 2

    • @aimzone8672
      @aimzone8672 7 หลายเดือนก่อน +2

      n=int(input("Enter the number of rows"))
      z = int(input("Column Increment : "))
      for i in range(n):
      for j in range(z*i+1):
      print("*",end=" ")
      print()
      better one , I just made a bit change

  • @maheshrishi223
    @maheshrishi223 5 หลายเดือนก่อน +3

    The way you are explaining the each step is the most loved thing 🎉❤
    Thank you so much

  • @abdkumar1300
    @abdkumar1300 7 ปีที่แล้ว +44

    for i in range(1,6):
    for j in range(1,(2*i)):
    print("*",end=" ")
    print()
    this is simple.

    • @avinashbasetty
      @avinashbasetty 5 ปีที่แล้ว +2

      smart programmer

    • @prateekrai5221
      @prateekrai5221 4 ปีที่แล้ว +1

      but why (1,6) for i we only want 3 rows i think its not correct for this particular figure

    • @karthikeyan-lv6wu
      @karthikeyan-lv6wu 4 ปีที่แล้ว +4

      @@prateekrai5221 just change 6 to 4 ...... It is just a number...... Logic is important not number.....

    • @rohithr811
      @rohithr811 4 ปีที่แล้ว

      @@prateekrai5221 this program executed correctly try it

    • @rohithr811
      @rohithr811 4 ปีที่แล้ว

      Good👏👏👏

  • @TheMikifer
    @TheMikifer 5 ปีที่แล้ว +7

    Very good and clear. I like how you explain it step-by-step. Thank you!

  • @iam.superaman
    @iam.superaman 4 ปีที่แล้ว +3

    Your explanation, your voice, your english, and your knowledge of Python...everything is so sweet and perfect 👌🏻 So sweet of You and your work⭐️

    • @AmulsAcademy
      @AmulsAcademy  4 ปีที่แล้ว +1

      Thank you so much 😀

  • @ramyanune5141
    @ramyanune5141 5 ปีที่แล้ว +8

    num = int(input('enter any number '))
    for row in range(1,num+1,2):
    for col in range(1,row+1):
    print('*',end=' ')
    print()

  • @padmalaswathi4443
    @padmalaswathi4443 6 หลายเดือนก่อน +1

    num=int(input("Enter the numbers to print output"))
    for i in range(1,num+1):
    for j in range(1,2*i):
    print("*",end=" ")
    print()
    This is simple way use this program

  • @Sapna6215
    @Sapna6215 5 ปีที่แล้ว +3

    with due respect
    n=int(input("Enter the number of row:"))
    for row in range(1,n+1):
    for col in range(1,row):
    print("*",end="")
    for col in range(1,row+1):
    print("*",end="")
    print()
    thanks for helping me get understanding how loop works.

  • @SportsFreak
    @SportsFreak 3 ปีที่แล้ว +5

    So now the "j" value is "tree(3)".... Love the way you pronounce that !!

    • @AmulsAcademy
      @AmulsAcademy  3 ปีที่แล้ว +2

      Haha...thank you :)

    • @anoop3721
      @anoop3721 3 ปีที่แล้ว

      @@AmulsAcademy How to reverse this right angled triangle in same manner ? Please help

    • @preetishkumarnayak9061
      @preetishkumarnayak9061 3 ปีที่แล้ว

      @@anoop3721 num = int(input("Please enter the number of rows: "))
      k = 5
      for i in range(num):
      for j in range(k):
      print("* ", end ="")
      k = k - 2
      print()

  • @nabilelassaad6086
    @nabilelassaad6086 3 ปีที่แล้ว +5

    n = eval(input("Please enter a number: "))
    or we can use int(input("Please enter a number: "))
    for i in range(1,n+1 ,2 ):
    for j in range(1,i+1 ):
    print("*" , end = " ")
    print(" ")
    Easer and more performance

    • @yasserneyazi8320
      @yasserneyazi8320 27 วันที่ผ่านมา

      Your input number will not be the number of rows then

    • @yasserneyazi8320
      @yasserneyazi8320 27 วันที่ผ่านมา

      4 rows input will give 2 rows

  • @interstellar077
    @interstellar077 3 ปีที่แล้ว +3

    I just love thiss.....💌💌💌
    "Welcome to python programming tutorials by Amulyas academy"....
    Specially "Python" word the way you say....💌💌💌💌💌💌💌💌

  • @kumarinaidu213
    @kumarinaidu213 5 ปีที่แล้ว +11

    i luv ur voice

  • @dhruvgupta6187
    @dhruvgupta6187 4 ปีที่แล้ว +3

    Thanks Amulya's Academy!!!
    Here's another way of writing it.
    n = int(input("Enter the number of rows..: "))
    for i in range(n):
    print('* '*(2*i+1))
    Happy programming !!!

  • @Travellife8877
    @Travellife8877 4 ปีที่แล้ว +2

    this method also works----in rows loop if we use (::2)
    n=int(input("enter no. of rows:"))
    for row in range(1,n+1,2):
    for col in range(1,row+1):
    print("*",end=" ")
    print()

  • @nmtamil4774
    @nmtamil4774 8 หลายเดือนก่อน +6

    Too much of confusion for this video.. control is here! This for loop😢... That for loop😢

  • @Akhil-fr9de
    @Akhil-fr9de 7 ปีที่แล้ว +1

    Quite helpful.....And what a pleasant voice of explanation......Thanks alot for the point to point explanation.

  • @ImJhon-jr5tn
    @ImJhon-jr5tn 4 ปีที่แล้ว +1

    Akka sooperah theliva solli tharinga romba thankyou akka🤝👏👏👏

  • @rakshak703
    @rakshak703 หลายเดือนก่อน

    Superb.... understood well.. thank you ❤

  • @harikrishna-nu2vh
    @harikrishna-nu2vh 4 ปีที่แล้ว +2

    n = int(input("enter the number of rows: "))
    for i in range(n):
    print("* "*(2*i+1))

    • @utkarshmalik4471
      @utkarshmalik4471 4 ปีที่แล้ว

      please explain the print("* "*(2*i+1))

  • @xoxo-yp1fc
    @xoxo-yp1fc 4 ปีที่แล้ว +5

    for x in range(1,6,2):
    print('*'*x,'
    ')

  • @the5minutepodcast694
    @the5minutepodcast694 6 ปีที่แล้ว +5

    Simple code (And a bit more optimized too!):
    for i in range(1, n, 2):
    print (i * '*')

  • @rohitgadekar8421
    @rohitgadekar8421 5 ปีที่แล้ว +2

    You can try dis too
    for i in range(1,4):
    for j in range(1,i*2):
    print("*",end="")
    print()

  • @nilsaha8021
    @nilsaha8021 4 ปีที่แล้ว +1

    num = int(input("Enter the number of rows: "))
    for row in range (0, num):
    for col in range (0, 2*row+1):
    print("*", end=" ")
    print()

  • @ruhichoudhary1755
    @ruhichoudhary1755 4 ปีที่แล้ว +3

    You are really amazing, the way you explain is just perfect.
    I am new to programming and just could easily understand what you are doing.
    Thanks a lot.

  • @ramswarooppoonia9655
    @ramswarooppoonia9655 5 ปีที่แล้ว +1

    in simplest way:
    num=int(input("Enter Range"))
    for i in range(0,num):
    for j in range(0,2*i-1):
    print("*",end=" ")
    print()

    • @AmulsAcademy
      @AmulsAcademy  5 ปีที่แล้ว

      Yes :)
      But in the output first row is printing empty, so change the range for that.
      :)

  • @Mars-el5gc
    @Mars-el5gc 2 ปีที่แล้ว

    Very good and very clear explanation madam

  • @khitesh04
    @khitesh04 7 ปีที่แล้ว +1

    for single line run use.
    for i in range(num):
    print(" "*(row +i)+"1"*(i*2+1)
    seen it somewhere in clg days.

    • @rajeshs2840
      @rajeshs2840 5 ปีที่แล้ว

      This is single line:-
      print("
      ".join(["*"*i for i in range(1,int(input("Enter the number of rows"))+1)]))

  • @amarsinhjadhav8156
    @amarsinhjadhav8156 ปีที่แล้ว

    Very nice explained step by step
    Thank you so much👍🙂

  • @ChandraMouli-zj8hj
    @ChandraMouli-zj8hj 6 ปีที่แล้ว +1

    num = int(input("Enter the number of rows : "))
    for i in range(1,num+1):
    for j in range(1,i*2):
    print("*",end = " ")
    print()

  • @Tejashwinibujji777
    @Tejashwinibujji777 4 ปีที่แล้ว +2

    num = 5
    for i in range(1,num+1,2):
    print('*'*i)
    can't we use this code??

    • @AmulsAcademy
      @AmulsAcademy  4 ปีที่แล้ว +1

      If it is working then you can :)

    • @Tejashwinibujji777
      @Tejashwinibujji777 4 ปีที่แล้ว +2

      @@AmulsAcademy it's working for me... thanks a lot... this is really a wonderful series for a beginner 😊☺️

  • @saikishoredantam
    @saikishoredantam 5 ปีที่แล้ว +1

    n=int(input('enter a number: '))
    for i in range(n):
    print('* '*(2*i+1))

  • @ayodejiabidemi2672
    @ayodejiabidemi2672 3 ปีที่แล้ว +1

    You are such an excellent tutor. God bless you.

  • @SwapnaTanneeru-nj6hc
    @SwapnaTanneeru-nj6hc ปีที่แล้ว

    Awesome explanation mam thank so much you create a good feature for us by this session 👏

  • @irfankpm9643
    @irfankpm9643 9 หลายเดือนก่อน

    n = int(input("Enter the number of rows"))
    for i in range(0,n):
    print((2*i+1) * "* ")

  • @ahmedsersawy6853
    @ahmedsersawy6853 4 ปีที่แล้ว +1

    you are the best thanks

  • @СергейКондулуков-з9ч
    @СергейКондулуков-з9ч ปีที่แล้ว

    Очень хороший урок. Авторам большое спасибо.

  • @Hackworm
    @Hackworm 2 ปีที่แล้ว

    Continue this series 🙏

  • @toxicmemer_
    @toxicmemer_ ปีที่แล้ว

    Aapko Bahot Sara Thank You

  • @Sunny_Reddy.
    @Sunny_Reddy. ปีที่แล้ว +1

    N=int(input(""))
    For i in range(0,n,2):
    For j in range(0,n):
    Print(end="")
    Print("s",end="")
    Print()

  • @abhijeetw9811
    @abhijeetw9811 6 ปีที่แล้ว +1

    Amulya Shetty madam thank you very much.

  • @Sumit-jz5vk
    @Sumit-jz5vk 4 ปีที่แล้ว +1

    Wow very nyc explain thanks

  • @sanjaykumar-oh5pt
    @sanjaykumar-oh5pt 7 ปีที่แล้ว +2

    realy helpfull.. thanks

  • @vikaskait5057
    @vikaskait5057 5 ปีที่แล้ว +2

    mam i am getting 9 stars in 3rd row plz help:
    num = int(input('Enter the number of rows:'))
    k=1
    for i in range(1,num+1):
    for j in range(1,k+1):
    print("*",end=" ")
    k=k+2
    print()

    • @AmulsAcademy
      @AmulsAcademy  5 ปีที่แล้ว +2

      num = int(input('Enter the number of rows:'))
      k=1
      for i in range(1,num+1):
      for j in range(1,k+1):
      print("*",end=" ")
      k=k+2 #this should be present outside the j th for loop
      print()

  • @smdsohail
    @smdsohail ปีที่แล้ว

    very
    well explained

  • @spencerx7963
    @spencerx7963 7 ปีที่แล้ว +1

    Helps a lot, Thanks!

  • @barryallen6217
    @barryallen6217 3 ปีที่แล้ว

    for i in range(1,6,2):
    print(i)
    Output:
    1
    3
    5
    Soooo:
    for i in range(1,6,2):
    for i in range(i):
    print("*",end="")
    print()

  • @user-dj7xj3iy8t
    @user-dj7xj3iy8t 9 หลายเดือนก่อน

    n=3
    for i in range(1,n+1):
    stars ="*"*(2*i-1)
    print(stars)

  • @sreenathreddy7087
    @sreenathreddy7087 4 ปีที่แล้ว +1

    Make videos on examples of oops concept in Python ...☺️

  • @shrutichavanaik5782
    @shrutichavanaik5782 4 ปีที่แล้ว +1

    Thank you mam

  • @krishnachaitanya9622
    @krishnachaitanya9622 3 ปีที่แล้ว +1

    can u please comment the same program in equilateral triangle form instead of rightangle triangle

    • @AmulsAcademy
      @AmulsAcademy  3 ปีที่แล้ว

      Pyramid shape? Already uploaded.

  • @sarthaksinghrajput5911
    @sarthaksinghrajput5911 4 ปีที่แล้ว +1

    //simple form to form even no. Of pattern!
    num=int(input("enter the number"))
    i=1
    for i in range(i,num,2)
    Print(i*"*")

  • @giridharpatro5239
    @giridharpatro5239 5 หลายเดือนก่อน

    We can also use while loop to print this pattern 😊

  • @gamecircle9447
    @gamecircle9447 7 ปีที่แล้ว +1

    U can do it by multipying too

  • @kamalbhatt1415
    @kamalbhatt1415 3 ปีที่แล้ว

    num=int(input("enter num :"))
    k=1
    for i in range(0,num):
    for j in range(0,k):
    print("*",end=" ")
    k=k+2
    print()
    try this one

  • @kamalbhatt1415
    @kamalbhatt1415 3 ปีที่แล้ว +1

    why we start loop from 1 to num+1
    we can also use 0 to num

  • @pondapelagechandima8186
    @pondapelagechandima8186 6 ปีที่แล้ว +1

    Hello, Could you please do some tutorials for "pyspark" ?

  • @harshtiwari2150
    @harshtiwari2150 5 ปีที่แล้ว

    for i in range(1,7,2):
    for j in range(1,i+1,1):
    print('*',end=" ")
    print()
    this is even simpler

  • @mohammadrifathhassan5141
    @mohammadrifathhassan5141 4 ปีที่แล้ว

    def pattern():
    num = int(input("Enter your rows: "))
    for i in range(1, num+1,2):
    for j in range(1, i+1):
    print("*", end=" ")
    print()
    pattern()

  • @vrahul6761
    @vrahul6761 4 ปีที่แล้ว

    N=int(input())
    for i in range(1,N+1,2):
    print('*'*i)

  • @evaldoaraujo4145
    @evaldoaraujo4145 4 ปีที่แล้ว

    Very Nice!

  • @Ishaheennabi
    @Ishaheennabi 4 หลายเดือนก่อน

    useful thanks

  • @prasanthnaidu9655
    @prasanthnaidu9655 4 ปีที่แล้ว +1

    The way u r explaining is good.
    But the above explained program, when I'm trying to execute I'm not getting the required output.

    • @AmulsAcademy
      @AmulsAcademy  4 ปีที่แล้ว

      Give me the program i will check :)

    • @pranjalkulkarni3429
      @pranjalkulkarni3429 3 ปีที่แล้ว

      hey im also not getting the reqd output

  • @shivanshusharma20.07
    @shivanshusharma20.07 6 ปีที่แล้ว +1

    For my better understanding if i take (k+2) inside "j" loop 9 star is coming of 5 star . How will loop work in this case plz explain??

  • @creativecoding8728
    @creativecoding8728 10 หลายเดือนก่อน

    num_of_rows = int(input('Enter the number of rows: '))
    print()
    for i in range(1, num_of_rows * 2 + 1):

    for j in range(i, i+1):
    if j % 2 == 1:
    print('* ' * j)
    print()

  • @giridharpatro5239
    @giridharpatro5239 5 หลายเดือนก่อน

    N = int(input())
    for i in range (1,n+1):
    print(i * "* ")
    This will print above pattern

  • @androgamerz1115
    @androgamerz1115 2 ปีที่แล้ว

    Is very Simple if u use step-size

  • @HariBabu-mx8qq
    @HariBabu-mx8qq 4 ปีที่แล้ว

    n=int(input("Enter Num : "))
    k=1
    for i in range(n):
    print('1'*(k))
    k=k+2

  • @charu4963
    @charu4963 4 ปีที่แล้ว +1

    Mam...why we are using k variable mam..I couldn't get that point..plz explain

    • @AmulsAcademy
      @AmulsAcademy  4 ปีที่แล้ว +1

      In every row we need odd number of stars that's why we are sung k variable.
      You can write this program like this also :)
      n = int(input("rows:"))
      for i in range(n):
      for j in range(0,(2*i)+1):
      print("*",end=" ")
      print()

    • @charu4963
      @charu4963 4 ปีที่แล้ว

      @@AmulsAcademy thank you mam

  • @yashwanthvb8442
    @yashwanthvb8442 4 ปีที่แล้ว

    n=int(input())
    i=1
    if i==1:
    print('*')
    for i in range(1,n):
    print('*' * (2*i+1))

  • @krishnagaff
    @krishnagaff 5 ปีที่แล้ว

    for i in range(1,int(input('> '))+1,2):print('*'*i)

  • @qamarsiddique794
    @qamarsiddique794 หลายเดือนก่อน

    is this logic ok ?
    num=int(input(enter the num of rows))
    for i in range(0,num)
    for j in range (0,2i+1)
    print("*" end=" ")
    print()

  • @sruthisruthihasan5829
    @sruthisruthihasan5829 2 ปีที่แล้ว

    n=int(input())
    for i in range(n):
    for j in range((2*i)+1):
    print("*",end=" ")
    print()

  • @rajeswarynadarajan8347
    @rajeswarynadarajan8347 5 หลายเดือนก่อน

    rows=int(input("Enter The number of rows: "))
    for i in range (1, rows +1, 2):
    for j in range ( 1, i+1):
    print("*",end="")
    print()
    please find my way also

  • @anmol3457
    @anmol3457 3 ปีที่แล้ว +1

    Shouldn't the input statement ask for the number of columns ?

    • @AmulsAcademy
      @AmulsAcademy  3 ปีที่แล้ว

      Number of column is dependent on number of rows here .

  • @asifsiddique7543
    @asifsiddique7543 5 ปีที่แล้ว

    num = int(input("enter the number of rows:"))
    for i in range(1, num + 1):
    for j in range(1, i + 1):
    if i % 2 != 0:
    (if i % 2 == 0:
    ) /// for even numbers
    print('*', end="")
    print()

    • @sarbajyotimallik
      @sarbajyotimallik 4 ปีที่แล้ว

      simple=>?
      no=int(input('enter no of rows'))
      for i in range(1,no+1):
      for j in range(1,i+1):
      if i%2==1:
      print('*',end=" ")
      print()

  • @ankushmishra9812
    @ankushmishra9812 5 ปีที่แล้ว +1

    for i in range (5):
    print('*'+ '*'*2*i)

  • @anoop3721
    @anoop3721 3 ปีที่แล้ว

    How to reverse this right angled triangle in same manner (odd number wise) ?
    Please help

  • @venkatesh91002
    @venkatesh91002 2 ปีที่แล้ว

    n=3
    for i in range(n+3):
    if i==0 or i%2!=0 and i!=1:
    for j in range(i+1):
    print('*',end='')
    print()
    Can we write like this?

  • @rajeshs2840
    @rajeshs2840 5 ปีที่แล้ว

    n = int(input("Enter the number of rows"))
    print("
    ".join(["*"*i for i in range(1,n+1)]))

  • @narenmarkglen
    @narenmarkglen ปีที่แล้ว

    Thanks

  • @vaibhavkhavare
    @vaibhavkhavare 4 ปีที่แล้ว

    max = int(input( "Enter max no of stars : "))
    for i in range (1 , max+1 ):
    if (i % 2) != 0:
    for j in range (1 , i+1):
    print (" * " , end=" ")
    print("")

  • @Ankur_code
    @Ankur_code ปีที่แล้ว

    n=500000000000000000000000000000000000000000000000000000000000000000000
    for i in range(n):
    print("teach very nice")

  • @somayehmadadpour8833
    @somayehmadadpour8833 3 ปีที่แล้ว

    If we put j in ( 1,2i) I think that it will work too

  • @evaldoaraujo4145
    @evaldoaraujo4145 4 ปีที่แล้ว

    num = int(input("Enter the number of rows: "))
    for i in range(num):
    print(i * " * ")
    Output:
    *
    **
    ***
    ****

  • @yudhveersingh8177
    @yudhveersingh8177 9 หลายเดือนก่อน

    Where I get loop program

  • @Drytube
    @Drytube 4 ปีที่แล้ว

    for i in range(1, n+1, 2): print('* '*i)

  • @sandhyajain7472
    @sandhyajain7472 4 ปีที่แล้ว

    Why K = K+2 outside of inner for loop. Regards

  • @RaviKumar-u3p7u
    @RaviKumar-u3p7u 6 หลายเดือนก่อน

    J in range (1,i+i)
    This will be working...

  • @saiesh_war2221
    @saiesh_war2221 5 ปีที่แล้ว

    for i in range (n):
    Print('* '*(i+i+1))

  • @sarathsaipeteti6029
    @sarathsaipeteti6029 4 ปีที่แล้ว +1

    you made a mistake here but i dont know how you got the right output after print statement k=j+2 then you'll get the right answer!!!!

    • @AmulsAcademy
      @AmulsAcademy  4 ปีที่แล้ว

      What is the mistake ? :)

    • @sarathsaipeteti6029
      @sarathsaipeteti6029 4 ปีที่แล้ว

      @@AmulsAcademy at 2:41 you have written k= k+2 in program but when i tried in pycharm iam getting output only by keeping k=j+2

  • @madhugandrapu8140
    @madhugandrapu8140 ปีที่แล้ว

    Tq

  • @oyedeepak
    @oyedeepak 5 ปีที่แล้ว

    rows = int(input('Enter the number of rows: '))
    k = 1
    for i in range(0, rows):
    for j in range(0, k):
    print("!",end="")
    k = k+2
    print()
    Code should be readable, please don't make it complicated.

    • @DhanalakshmiSivasubramanian
      @DhanalakshmiSivasubramanian ปีที่แล้ว

      You use third line as rows, but range always take as n+1 you want put there as rows+1

  • @naveenadhikari5953
    @naveenadhikari5953 6 ปีที่แล้ว +1

    A little tricky for Mee this time 🤨🤨🤨

    • @AmulsAcademy
      @AmulsAcademy  6 ปีที่แล้ว

      You can write it in simple way also:)

    • @naveenadhikari5953
      @naveenadhikari5953 6 ปีที่แล้ว

      What is the simplest way mam tell me 🤨🤨

  • @laxmank544
    @laxmank544 2 ปีที่แล้ว

    List = [2.5,9,6,'7.2',3,8,5] #can any one sort.

  • @sujaysinha81
    @sujaysinha81 3 ปีที่แล้ว

    Can I do this
    print("* * * * *")
    print ("* * * *" )
    print("* * *")
    print("* *")
    print("*")

  • @gauravkumar2602
    @gauravkumar2602 3 ปีที่แล้ว

    That's the best things about python that you can these write these kind of pattern in many ways and reduce time and space complexity.
    rows = int(input("Enter number of rows: "))
    k=1
    for i in range(1,rows+1):
    print("*" * k)
    k=k+2

    • @naitlimamhamdi5888
      @naitlimamhamdi5888 3 ปีที่แล้ว

      You can even remove the variable 'k'. print("
      ".join(["*"*i if i==1 else "*" * (i*2-1) for i in range(1, int(input("Enter number of rows: "))+1)]))

  • @Rahul-gm4pv
    @Rahul-gm4pv ปีที่แล้ว

    I like her voice

  • @Mohitsharmaskp
    @Mohitsharmaskp ปีที่แล้ว

    👍👍

  • @ahilinath4157
    @ahilinath4157 4 ปีที่แล้ว +1

    A
    B A
    C B A
    D C B A
    E D C B A
    Ma'am plz print the about pattern in python

  • @shoeswholesalerforreseller7633
    @shoeswholesalerforreseller7633 5 ปีที่แล้ว

    We can write like this
    n=7
    for i in range(1,n+1,2):
    for j in range(i):
    print("*",end=' ')
    print()