Python Pattern Program - Printing Stars '*' in B Shape

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ธ.ค. 2024

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

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

    These are the videos essentials for programmers to know logic.. thank you Amul.

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

    This channel is underrated. This is master class material!

  • @KrishnaVamsi-w8v
    @KrishnaVamsi-w8v 3 หลายเดือนก่อน +1

    After See these Patterns Video I am aware of all the A-Z Alphabets Thank you mam

  • @gurdeepsingh-jl5rf
    @gurdeepsingh-jl5rf 3 ปีที่แล้ว +4

    I just love how this much effort she puts into her video great job 👌

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

    Hi ma'am,,,,thank u sooo much ,,,by watching ur valuable classes now I can able to print any pattern.
    a=input("Enter the name of Academy")
    X=["Jnstitute:AmulsAcedemy","Rating:10/10"]
    for i in X:
    print(i)

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

    Code-
    for row in range(7):
    for col in range(5):
    if (col==0) or (col==4 and (row!=0 and row!=3 and row!=6)) or ((row==0 or row==3 or row==6) and (col>0 and col

    • @ሳራክፍላይ
      @ሳራክፍላይ ปีที่แล้ว

      Too long. How about like this
      for row in range(7):
      for column in range(5):
      if (row in [0, 3, 6] and column in [0, 1, 2, 3]) or (row in [1, 2, 4, 5] and column in [0, 4]):
      print('*', end=' ')
      else:
      print(" ", end=' ')
      print()

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

    print(" you are the best one ..... thanks amuls academy")

  • @ሳራክፍላይ
    @ሳራክፍላይ ปีที่แล้ว

    for row in range(7):
    for column in range(5):
    if (row in [0, 3, 6] and column in [0, 1, 2, 3]) or (row in [1, 2, 4, 5] and column in [0, 4]):
    print('*', end=' ')
    else:
    print(" ", end=' ')
    print()

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

    Very helpful video 👍👍👌👌 cleared voice 👌👌

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

    Thankuu so much for such a useful video . I liked the way u teach and the most important thing is u explained it very beautifully

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

    Keep doing well madam..
    All the best ...

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

    Great you are very brilliant programmer

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

    thank you so much,you make the problems very easy

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

    grateful to you for all these videos

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

    Thanks you for amul academy to python language easy learn
    Amazing you are

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

    Hi Ma'am,
    i am still getting the same B in box shape instead of 'B'.
    for row in range(7):
    for col in range(5):
    if (col==0) or (col==4 and (row!=0 and row!=3 and row!=6)) or ((row==0 or row==3 or row==6) or (col4)):
    print('*',end='')
    else:
    print(end=' ')
    print()
    Can you plz ,let me know the difference?

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

      Try this:
      for row in range(7):
      for col in range(5):
      if (col==0) or (col==4 and (row!=0 and row!=3 and row!=6)) or ((row==0 or row==3 or row==6) and (col>0 and col

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

    Thank you for making this so easy

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

    u r really master in coding..
    i watching your videos many time but im does not understand your condition which u used...

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

      Thank you:)If you have any doubt you can ask:)

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

      how u think to used "and, or" operator at the correct time..?

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

      'and' is used when you want to both the condition to be true.'or' is used when you want any one of the condition to be true.
      example:
      In this program we can see col>0 and col0 or col0 or col0 condition here col value is 0.so 0 is not greater than 0 so first condition fails then it sees the operator it is 'or' so it will check next condition that is col0 and col

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

      @@AmulsAcademy But in case of printing A shape (case 1) why you use and could we also use there or na .(col ==0 or col==4) and row!=0) and (row== 0 or row==3)and col>0 and col

  • @s.harinarayan7552
    @s.harinarayan7552 4 ปีที่แล้ว

    How can I print multiple "letters" like this horizontally? I used a for loop with ifs within to print patterns like this for every alphabet in a string which the user inputs. But that will print the word vertically, the letters one below the other. I want the letters to be at the same horizontal level. Help?

  • @adarshsinghrinshu4307
    @adarshsinghrinshu4307 6 ปีที่แล้ว +2

    What should we do for n number instead of 7?

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

      We cant draw B shape for every number, but you can form a general formula and can print B for few number of rows:)

  • @vijay2002-g4m
    @vijay2002-g4m ปีที่แล้ว +1

    #only works for odd number inputs
    r = int(input())
    c = int(input())
    for i in range(r):
    for j in range(c):
    if (i%(r//2)==0 and j!=c-1) or (j%(c-1)==0 and i%(r//2)!=0):
    print("* ",end='')
    else:
    print(end=' ')
    print()

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

    I have done code for print B ,But i could not able to get last column
    for row in range(7):
    for col in range(5):
    if ((row==0 or row==3 or row==6) and (col!=4)) or ((col==0 and row!=0) and (row!=0 or row!=6)):
    print("*",end="")
    else:
    print(end=" ")
    print ()
    Where it was failed?

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

    Col 4 is printing in col 2,so m no getting exact shape of B
    ****
    * *
    * *
    ****
    * *
    * *
    ****
    Like this
    Plz solve my problm

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

      In the else part you need to print space, you are missing that :)

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

      In else part ai'nt create the space that's why it's happening.
      In your else part put this
      else:
      print(end = ' ')

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

    Best Video.. thanks alot

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

    Thank you so so so much. These videos were damn helpful. I was able to display the pattern of my whole name. Once again thank you so much>

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

    Thank you ma'am 🙏

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

    Which state you mam

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

    I love you...sweet, very help me to understand how to use condition properly.

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

    nice video madam
    i want to the telugu classes madam
    please upload the telugu classes

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

      Thank you:)
      I don't know telugu:)

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

    THANK YOUUUU🙂

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

    Thanku amul

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

    Explanation is excellent,but output is not come....it shows some invalid syntax

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

      Thank you :)
      Give me the program please i will check :)

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

      @@AmulsAcademy if (col==0 or col==4) or ((row==0 or row==3 or row==6) and (col>0 and col< 4)):
      NameError: name 'col' is not defined
      >>>

  • @nagendraKumar-qp6qf
    @nagendraKumar-qp6qf 5 ปีที่แล้ว +1

    I execute this code all stars are displayed vertically i didn't get required shape

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

      i think you didn't use end="" in print()
      :)

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

    Ma'am can you help me in pattern that I have to print border of Diamond

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

    If we want in n th row instead of specifying 3rd row how it is???

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

      Amulya garu want an immediate reply

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

      You will get correct shape for odd number input.
      num = int(input("row:"))
      col = num-2
      mid = num//2
      for i in range(num):
      for j in range(col):
      if j==0 or (j==(col-1) and (i!=mid and i!=0 and i!=num-1)) or ((i==0 or i==mid or i==num-1) and (j!=col-1)):
      print("*",end=" ")
      else:
      print(" ",end=" ")
      print()
      :)

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

    the first type of B looks more like the number 8

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

    sister can we make a pattern by using recursive function

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

    Dhanyavad :)

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

    How to print 2 pattern character in single line

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

      1. write down alphabets in a paper
      2. both alphabet should have same row numbers.
      3. Check in which row and column you want star, write the condition for that.
      :)

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

      @@AmulsAcademy thanks

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

    Use this Hindi language class please one video

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

    It is not displaying the correct pattern in my lappy

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

    i don't understand why you wrote 'print ()'

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

      For the new line after each row.
      remove that and run your program, you will understand.
      :)

  • @vineethreddy.s
    @vineethreddy.s 6 ปีที่แล้ว +1

    FAB..

  • @md.jamilkhan8326
    @md.jamilkhan8326 5 ปีที่แล้ว +1

    Your programing gives error in my python, pls so the execution also 😐😐 and how to correct the Error

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

      I did execute my program in the video :)

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

    👏

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

    madam getting error while doing the same problem in my idle 3.7

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

    hindi ma bolaya na

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

    Thanks you for amul academy to python language easy learn
    Amazing you are