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)
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()
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()
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?
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
'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
@@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
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?
#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()
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?
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() :)
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. :)
These are the videos essentials for programmers to know logic.. thank you Amul.
My Pleasure :)
This channel is underrated. This is master class material!
Thank you :)
After See these Patterns Video I am aware of all the A-Z Alphabets Thank you mam
Great 👍
I just love how this much effort she puts into her video great job 👌
Thank you 😊
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)
Glad to hear that :)
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()
print(" you are the best one ..... thanks amuls academy")
Thank you :)
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()
Very helpful video 👍👍👌👌 cleared voice 👌👌
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
Most welcome 😊
Keep doing well madam..
All the best ...
Great you are very brilliant programmer
Thank you :)
thank you so much,you make the problems very easy
Happy to help :)
grateful to you for all these videos
Glad you like them!
Thanks you for amul academy to python language easy learn
Amazing you are
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?
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
Thank you for making this so easy
Pleasure :)
u r really master in coding..
i watching your videos many time but im does not understand your condition which u used...
Thank you:)If you have any doubt you can ask:)
how u think to used "and, or" operator at the correct time..?
'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
@@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
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?
What should we do for n number instead of 7?
We cant draw B shape for every number, but you can form a general formula and can print B for few number of rows:)
#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()
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?
Because you didn't write condition for column 4(last column).
Thanks
Col 4 is printing in col 2,so m no getting exact shape of B
****
* *
* *
****
* *
* *
****
Like this
Plz solve my problm
In the else part you need to print space, you are missing that :)
In else part ai'nt create the space that's why it's happening.
In your else part put this
else:
print(end = ' ')
Best Video.. thanks alot
Glad you liked it :)
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>
My Pleasure :)
Thank you ma'am 🙏
Which state you mam
Karnataka :)
I love you...sweet, very help me to understand how to use condition properly.
Thank you :)
nice video madam
i want to the telugu classes madam
please upload the telugu classes
Thank you:)
I don't know telugu:)
THANK YOUUUU🙂
Thanku amul
Pleasure :)
Explanation is excellent,but output is not come....it shows some invalid syntax
Thank you :)
Give me the program please i will check :)
@@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
>>>
I execute this code all stars are displayed vertically i didn't get required shape
i think you didn't use end="" in print()
:)
Ma'am can you help me in pattern that I have to print border of Diamond
If we want in n th row instead of specifying 3rd row how it is???
Amulya garu want an immediate reply
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()
:)
the first type of B looks more like the number 8
sister can we make a pattern by using recursive function
Dhanyavad :)
Thank you :)
How to print 2 pattern character in single line
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.
:)
@@AmulsAcademy thanks
Use this Hindi language class please one video
It is not displaying the correct pattern in my lappy
i don't understand why you wrote 'print ()'
For the new line after each row.
remove that and run your program, you will understand.
:)
FAB..
Thank you:)
Your programing gives error in my python, pls so the execution also 😐😐 and how to correct the Error
I did execute my program in the video :)
👏
madam getting error while doing the same problem in my idle 3.7
good
hindi ma bolaya na
Thanks you for amul academy to python language easy learn
Amazing you are