in 12:20 when the text is larger, can you explain how we can fix that problem with out changing the number to 20? meaning the word will fit to the shape like "amuls" in one line fit to the stars and academy will go to new line
num = int(input("enter any number:")) msg= (input("enter any message:")) l = len(msg) n = num//2 for i in range(n): print(" "*(n-i-1) + "* "*(i+1),end="") if num%2==0: for j in range(2*(n-i-1)): print(" ",end ="") else: for j in range(2*(n-i-1)+1): print(" ",end="") for j in range(i+1): print("* ",end ="") print() print("* "*((num-1)//2) + " ".join(msg) + "* "*((num-1)//2) ) for i in range(num,0,-1): print(" "*(num-i) + "* "*(i)) is there any mistake i am getting extra one star after in 5th row
Can we print two alphabets character pattern in one line i.e not in next line but next(right side of it) to the first pattern And also can I follow you on Instagram - mine is - kaidi_no.25
Yes we can . This code will print NO. for i in range(5): for j in range(10): if j==0 or j==4 or j==6 or j==9 or (i==j and j5): print("*",end="") else: print(end=" ") print() 1. write down the pattern on paper. 2.both alphabet should contain same number of rows. 3. write down the condition in which row and column you want star. I don't have Instagram account now. Will join soon :) :)
n = 8 m = n+1 for i in range(n//2-1): for j in range(m): if i == n//2-2 and (j == 0 or j == m-1): print("*", end=" ") elif j m//2 and ((i+j == n//2-3+m//2 and j < 3*m//4) \ or (j-i == m//2-n//2+3+m//2 and j >= 3*m//4)): print("*", end=" ") else: print(" ", end=" ") print() for i in range(n//2-1, n): for j in range(m): if (i-j == n//2-1) or (i+j == n-1+m//2): print('*', end=" ") elif i == n//2-1: if j == m//2: print('A', end=" ") elif j == m//2+1: print('B', end=" ") elif j == m//2+2: print('C', end=" ") else: print(' ', end=" ") else: print(' ', end=" ") print() output is * * * * * * * * * * A B C * * * * * * * * this will print like this can you simplify this
Ur whole playlist is awesome pls always add on videos whenever u are free it's really helpful for me
The lecture is undoubtedly convenient for beginners like me. Thanks for your explanation in details
Thank you :)
Nice video explained super duper. Please madam mini project upload so helpfull for everyone and your channel
Sure will do soon:)
Thank you:)
in 12:20 when the text is larger, can you explain how we can fix that problem with out changing the number to 20? meaning the word will fit to the shape like "amuls" in one line fit to the stars and academy will go to new line
You can remove the space between the characters.
:)
Nice explaination
If we give the input as a number 100 what will be the output is it print the stars in the correct pattern
Mam.I want full code can you please send me
U can change the no. of columns with reference to the given name ryt!!! No need of user input
Pls put that cod in discription
python program to print patttern of stars heart shape in the middle of happpy children's day doubt dii
I want this code... please send me
num = int(input("enter any number:"))
msg= (input("enter any message:"))
l = len(msg)
n = num//2
for i in range(n):
print(" "*(n-i-1) + "* "*(i+1),end="")
if num%2==0:
for j in range(2*(n-i-1)):
print(" ",end ="")
else:
for j in range(2*(n-i-1)+1):
print(" ",end="")
for j in range(i+1):
print("* ",end ="")
print()
print("* "*((num-1)//2) + " ".join(msg) + "* "*((num-1)//2) )
for i in range(num,0,-1):
print(" "*(num-i) + "* "*(i)) is there any mistake i am getting extra one star after in 5th row
Can we print two alphabets character pattern in one line i.e not in next line but next(right side of it) to the first pattern
And also can I follow you on Instagram - mine is - kaidi_no.25
Yes we can .
This code will print NO.
for i in range(5):
for j in range(10):
if j==0 or j==4 or j==6 or j==9 or (i==j and j5):
print("*",end="")
else:
print(end=" ")
print()
1. write down the pattern on paper.
2.both alphabet should contain same number of rows.
3. write down the condition in which row and column you want star.
I don't have Instagram account now.
Will join soon :)
:)
@@AmulsAcademy thank you now I understood how to do it😊
@@AmulsAcademy but I want that user enter input and that print in the same as above you done
Welcome :)
Then you need to write the condition for every alphabet, and you need to check the input characters with alphabets.
It will be lengthy.
:)
n = 8
m = n+1
for i in range(n//2-1):
for j in range(m):
if i == n//2-2 and (j == 0 or j == m-1):
print("*", end=" ")
elif j m//2 and ((i+j == n//2-3+m//2 and j < 3*m//4) \
or (j-i == m//2-n//2+3+m//2 and j >= 3*m//4)):
print("*", end=" ")
else:
print(" ", end=" ")
print()
for i in range(n//2-1, n):
for j in range(m):
if (i-j == n//2-1) or (i+j == n-1+m//2):
print('*', end=" ")
elif i == n//2-1:
if j == m//2:
print('A', end=" ")
elif j == m//2+1:
print('B', end=" ")
elif j == m//2+2:
print('C', end=" ")
else:
print(' ', end=" ")
else:
print(' ', end=" ")
print()
output is
* * * *
* * *
* *
* A B C *
* *
* *
* *
*
this will print like this can you simplify this