ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
Python Pattern Program - Printing Stars in Heart Shape
ฝัง
- เผยแพร่เมื่อ 18 ส.ค. 2024
- In this Python Pattern Programming video tutorial you will learn How to print stars in heart shape in detail.
To print stars in heart shape we will use nested for loops. One for loop is for row and another one is for column .
This pattern is the combination of other three pattern.
To print stars in pyramid shape:
• Python Pattern Program...
Hollow heart pattern:
• Python Pattern Program...
#PythonPatternProgram #PythonPrograms
For more free tutorials on computer programming
/ amulsacademy
/ amulsacademy
One small correction to your code in case of odd number is:
extreme left is not matching with extreme right of the heart.
num=int(input('enter the no: '))
for i in range(num):
for j in range(num-i-1):
print(" ",end='')
for j in range(i+1):
print('* ',end='')
for j in range(2*(num-i-1)):
print(" ",end='')
for j in range(i+1):
print('* ',end='')
print()
for i in range(2*num,0,-1):
for j in range(2*num-i):
print(" ",end='')
for j in range(i):
print('* ',end='')
print()
The avobe code will work without any if condition.
@Amulya's Academy
Thanks for the tutorial though. It was really helpfull.:)
Most underrated video I found on this topic. Really great explanation...
Thank you so much :)
I have never seen anyone who explained python like you. You are an intellectual blessing
Ur voice is simply awesome,,and ur explanation is double awesome
Thank you very much I have sceen many videos but it didn't worked but your video program was worked keep doing like this
Amazing explanation ..You have described each and every word in this program very smoothly so that no one can get a doubt .. Thankyou so much 😊
You're inspiring!!
Dawg I appreciate you, this was very helpful.
Thank you 😊
for symmetric output , use
Very good presentation 👍👍👍👍👍
You are teaching well 😇😇
Tnq so much sharing ur knowledge
Nice explaination medam tq
Awesome mam
Nice voice 💥💥
very useful tuto, thank you amuls
but for odd numbers the output is not symmetric
yes :)
3rd part you can do by :
for i in range(8):
print(i*' ',(8-i)*'* ',end='')
Can we randomly delete the stars based on user input once it printed?
eliminating the first line gives perfect heart
Excellent
Thank you:)
I creat this pattern in java and c++ also but i want to rotate this design
Superr
thnks
Welcome :)
what does num %2 mean?
For even numbers :)
% means reminder if that number
15%2 it gives 1
Nice plz mini project
Will do soon:)
@@AmulsAcademy is it out already?
Do vedeo on tower of hanoi
Sure:)
Where did you get the formula 4-i-1?
Nm I understand. Thanks for the video.
ok
Error
Will you show us your face please one time only...
Very Nice!Can you make an video on Pyramid number for this pattern. Thanks!
1
1 1
1 2 1
1 2 2 1
Will try 😊