Dunno if you guys gives a damn but if you are bored like me during the covid times you can stream all of the latest movies and series on InstaFlixxer. Have been watching with my gf for the last few weeks xD
for i in range(1,5): for s in range(4,i-1,-1): print(" ",end='') for j in range(1,i*2): if((i==2 and j==2)or (i==3 and j==2)or (i==3 and j==3)or (i==3 and j==4)): print(" ",end='') else: print("*",end='') print() what about this one?
n=int(input("enter a no.")) for i in range(1,n+1): for j in range(1,n*2): if i+j==n+1 or j-i==n-1 or (i==n and j%2!=0): print("*",end="") else: print(" ",end="") print() by adding one more or operator we can make it short.
def hollow_triangle(n,m): for i in range(1, n ): for j in range(1, m): if (i == n-1 or i + j == n or j - i == m - n ) : print('*', end='') else: print(' ', end='') print()
Why to write elif condition, we can simply replace 'row==n' in 1st pgm with '(row==n and col%2!=0)' for 2nd pgm n=int(input("Enter number of rows: ")) for row in range(1,n+1): for col in range(1,2*n): if (row+col==n+1) or (col-row==n-1) or (row==n and col%2!=0): print("*",end="") else: print(" ",end="") print()
I am not getting correct output dear, this is my code: n=int (input("enter the number of row :")) for row in range (1,n+1): for col in range (1,2*n): if (row==n or row+col==n+1 or col-row==n-1): print("*",end="") else: print(end="") print()
In the else print you need to print space :) n=int(input("enter the number of row :")) for row in range (1,n+1): for col in range (1,2*n): if (row==n or row+col==n+1 or col-row==n-1): print("*",end="") else: print(end=" ") print() :)
Try this: n = int(input("rows:")) col=2*n-1 mid=col//2 for i in range(n): for j in range(col): if i+j==mid or j-i==mid or i==n-1: print("*",end="") else: print(" ",end="") print()
n=int(input("enter number of rows:")) for row in range(1,n+1): for col in range(1,2*n): if row==n or row+col==n+1 or col-row==n-1: print("*",end="") else: print(end=" ") print()
num = int(input("eneter the number of rows:")) for row in range(num): for col in range((2*num)-1): if row==(num-1) or (row+col==(num-1)) or (col-row==(num-1)) : print("*",end="") else: print(end=" ") print() :)
mam in this program if i select range for rows=(5) and col=(8) soo it shows error but when i choose range row=(1,5) and col=(1,8) then pattern is correct why please explain
That program is written for row 1 to 5 and col 1 to 8. we wrote if condition based on that . And range(5) is different from range(1,5). range(5) = 0, 1, 2, 3, 4 range(1,5) = 1, 2, 3, 4 To make it work for rows(5), you need to change the conditions also. :)
mam ye jo aapne general program likha hai maan lijiye agar isme col ki range (1,8) na hokr (1,7) hoti aur n ki value 4 hoti to kaise general range likhte col ke liye?
@@zainabbohra2915Yeah, cheers dude:) My question is old and dumb. Ironically, last week I got a job in signal processing & machine learning. This is a reminder(to me at least) to be patient and helpful to beginners.
for row in range(1,5): for col in range(1,8): if (row==3 or row+col==5 or col-row==3): print("*",end="") else: print(" ") print() but i m getting output wrong mam
for row in range(1,5): for col in range(1,8): if (row==4 or row+col==5 or col-row==3): print("*",end="") else: print(" ",end="") print() 1. in the if condition you wrote row==3 but you want stars at row 4 2. in the else part you need to include end ="" to keep the control in the same line. print(" ',end="") :)
for row in range(5): for col in range(7): if (row==0 and col%3!=0) or (row==1 and col%3==0) or row-col==1 or row+col==7: print("*",end="") else: print(end=" ") print()
Wow! explained things better than my CS teacher..
Thank you:)
Dunno if you guys gives a damn but if you are bored like me during the covid times you can stream all of the latest movies and series on InstaFlixxer. Have been watching with my gf for the last few weeks xD
@Morgan Matthias Definitely, been using instaflixxer for months myself :)
Respect from Algeria to you ..❤❤
Explaining all simple steps in each and every video....take a bow for your patience
Thank you :)
What a lucid explanation, thank you so much, madam. It was easily understood, especially for students from Non-IT branches like me.
It's my pleasure : )
Thank u lot❤
WOW!!! You deserve 10MILLION Subscribers!
❤️ Thank you 😊😊
for i in range(1,5):
for s in range(4,i-1,-1):
print(" ",end='')
for j in range(1,i*2):
if((i==2 and j==2)or
(i==3 and j==2)or
(i==3 and j==3)or
(i==3 and j==4)):
print(" ",end='')
else:
print("*",end='')
print()
what about this one?
n=int(input("enter a no."))
for i in range(1,n+1):
for j in range(1,n*2):
if i+j==n+1 or j-i==n-1 or (i==n and j%2!=0):
print("*",end="")
else:
print(" ",end="")
print()
by adding one more or operator we can make it short.
Your detailed exposition certainly helped me a lot! Thank u
Yes naming variables are good to see..they are very useful to understand easily..I preferred them mostly to students
Yes, true :)
Really love your videos about programming
Thank you :)
Wow mam!!! It's crystal clear mam !!!!great great very nicely explained 🙏Thank you so much ♥️
I love the way how u explain the detail. Love u
Thank you :)
Can u give code for the pattern similar to above. But the figure should turn towards it's right. The tip of this triangle should come towards right.
Very nice logic and very very nice explanation👌👌👌
Thank you so much 😀
@@AmulsAcademy I was thinking that while doing meditation instead of listening any another music i will listen you voice😄😄
Wow what a amazing explanation..
How to print * replace with numbers
Please explained
thank you! your explanation was phenomenal
Glad it was helpful! :)
Your explanations are very clear. Thanks
Thank you :)
awesome explanation. really liked your explanation... please keep up the good work
Thank you :)
very good video, u explanation is very simply and logical
Glad it was helpful! :)
Thanks a lot! you are a saviour. God bless!
You're welcome! :)
your explanation is great madam, thank you so much
You are most welcome :)
awesome explained the logic,. really
loved this
Glad to hear that! :)
Thank you so much for your explanation! Your logic really helped with a javascript exercise.
Glad it helped! :)
thank you very much you made programming easy
we are trying this pattern from last 6 days but nothing happens but you are love you
Thank you :)
excellent job! you explained very well.
Glad it was helpful! :)
wow simply and really well explained
Thanks a lot 😊
def hollow_triangle(n,m):
for i in range(1, n ):
for j in range(1, m):
if (i == n-1 or i + j == n or j - i == m - n ) :
print('*', end='')
else:
print(' ', end='')
print()
n=5
m=8
print(hollow_triangle(n,m))
Wonderful explanation👏
mind blowing 👏👏
thank you so much
Super explanation thank you 🙂
Why to write elif condition, we can simply replace 'row==n' in 1st pgm with '(row==n and col%2!=0)' for 2nd pgm
n=int(input("Enter number of rows: "))
for row in range(1,n+1):
for col in range(1,2*n):
if (row+col==n+1) or (col-row==n-1) or (row==n and col%2!=0):
print("*",end="")
else:
print(" ",end="")
print()
Very well explained..thanks
SUPER NICE!!
Thank you :)
I am not getting correct output dear, this is my code:
n=int (input("enter the number of row :"))
for row in range (1,n+1):
for col in range (1,2*n):
if (row==n or row+col==n+1 or col-row==n-1):
print("*",end="")
else:
print(end="")
print()
In the else print you need to print space :)
n=int(input("enter the number of row :"))
for row in range (1,n+1):
for col in range (1,2*n):
if (row==n or row+col==n+1 or col-row==n-1):
print("*",end="")
else:
print(end=" ")
print()
:)
I am your fan
Thank you ❤️
how i print a string inside a triangle(The same as your triangle)
please help me
Give me the pattern please :)
why you started index value of row and coloumn as 1 instead of 0.
you are legend i love you
Thank you :)
very good job .. nice explanation
Thank you:)
*
* *
* *
* *
* *
* *
*
Ma'am i want to print this pattern plz help.
Same as the triangle you explained but inverted. Plz help
Mam, in second program even we can write as col%2!=0 instead of taking another variable.
You can try :)
what if we want to give a constraint that n>2?
Try this:
n = int(input("rows:"))
col=2*n-1
mid=col//2
for i in range(n):
for j in range(col):
if i+j==mid or j-i==mid or i==n-1:
print("*",end="")
else:
print(" ",end="")
print()
n=int(input("enter number of rows:"))
for row in range(1,n+1):
for col in range(1,2*n):
if row==n or row+col==n+1 or col-row==n-1:
print("*",end="")
else:
print(end=" ")
print()
nter number of rows:5
* * * * * * * *********
there is no any mistake but the output is printing in horizontal way
In the Last line print() should be inside the first for loop.
I am getting error in elif row==n and column!=k
Can you please guide.
It is so great ! Thanks.
what to manipulate it for variable pattern range?
num = int(input("eneter the number of rows:"))
for row in range(num):
for col in range((2*num)-1):
if row==(num-1) or (row+col==(num-1)) or (col-row==(num-1)) :
print("*",end="")
else:
print(end=" ")
print()
:)
thank you very very very mutch🌸🌸💜💜
Welcome:)
I have only one doubt.... How do you number for column & rows as 0,1,2,... Or 1,2,3,...
thanks alot god bless you
Thank you :)
Good explanation
Thank you :)
Superb explanation can u help me in other code mam....
I will try :)
I want binomial coefficient in the form of equilateral triangle
mam in this program if i select range for rows=(5) and col=(8) soo it shows error but when i choose range row=(1,5) and col=(1,8) then pattern is correct why please explain
That program is written for row 1 to 5 and col 1 to 8.
we wrote if condition based on that .
And range(5) is different from range(1,5).
range(5) = 0, 1, 2, 3, 4
range(1,5) = 1, 2, 3, 4
To make it work for rows(5), you need to change the conditions also.
:)
You Are Great
mam ye jo aapne general program likha hai maan lijiye agar isme col ki range (1,8) na hokr (1,7) hoti aur n ki value 4 hoti to kaise general range likhte col ke liye?
Madam how to do print Hollow number traingle
mam this code does not work in python 3.7.4 what do i do
It should work in python 3.7.
getting any error?
it's working !!
even after writing end i am not getting output in horizontal
Give me the program i will check :)
Hello I have to clear 5 code test questions. .I need your help...will u help me out. As I have test tomorrow
All 5 questions are of python programming
Are u talking about whitehatjr??
thanks a lot man
THANKS A LOT!
Welcome :)
Thank you
You're welcome :)
hi! is it critical which "for" loop is to be the first one? a column loop or sting loop?
it is for row mate
@@zainabbohra2915Yeah, cheers dude:) My question is old and dumb. Ironically, last week I got a job in signal processing & machine learning. This is a reminder(to me at least) to be patient and helpful to beginners.
@@michaelshevelin2234 congrats 😎
It's not working for left start triangle shape
Why my CS teacher doesn't explain Like This
i am getting syntax error at else:
Give me the program i will check :)
How to create this type thought in mind. Please tell mam.
i'm not able to get my desired output.can you please fix it out .
code is here:
for row in range (0,3):
for col in range (0,6):
if row == 4 or row+col ==5 or col-row==3:
print("*",end="")
else:
print(end=" ")
for row in range(1,5):
for col in range(1,8):
if (row==3 or row+col==5 or col-row==3):
print("*",end="")
else:
print(" ")
print() but i m getting output wrong mam
for row in range(1,5):
for col in range(1,8):
if (row==4 or row+col==5 or col-row==3):
print("*",end="")
else:
print(" ",end="")
print()
1. in the if condition you wrote row==3 but you want stars at row 4
2. in the else part you need to include end ="" to keep the control in the same line.
print(" ',end="")
:)
How do you come up with the logic of row+col and col-row? I was thinking to calculate mid = n/2 and then display the * but it got complicated.
how can we print inverted hollow pyramid with same logic? anyone?
16:11
Hello I want a code to print heart shape
for row in range(5):
for col in range(7):
if (row==0 and col%3!=0) or (row==1 and col%3==0) or row-col==1 or row+col==7:
print("*",end="")
else:
print(end=" ")
print()
U r too good
In elif condition c%2!=0 if we write like dis we get output
We don't need to take k variable
انت مبدعه. ممتاز
You are soo cuute i love u ❤️❣️
Thank you :)
1,1,4,8,9,27,16,64 ye series list or for loop se kese solve hoge
Please solve this series
Ya fir is series se related series btao
n=int(input("enter the term:"))
a=1
for i in range (1,n+1):
if(i%2==0):
b=a**3
a=a+1
else:
b=a**2
print(b,end=" ")
I love you madammm 😁
wow what a logic
In row 4 two extra * us comming
give me the program please :)
*
* *
* *
*******
> This is th output I am getting with this code above
Not working for this
I m getting output wrong
Give me the program please :)
Ohh m sorry actually my mistake I give a space after end=" " that's why
Thankyou so much ma'am 😘😘
It's not working
Give me the program i will check :)
@@AmulsAcademy
No thanks madam I recognised the mistake I had done.once again tnx for responding mam
Mam Hindi me explain kijiye sabhi videos kko please
Explanation
#how
❣️❣️❣️
or miss
Angel
👍
super explanation 👏👏👏totally understandable