Комментарии:
agr * do bar call karega to kya ye extra memory use krega
ОтветитьWhy we are taking 0,n why not n
ОтветитьMadam , row and col evi = cheyalli
Space or stsrs ?
n=int(input())
for row in range (0,n):
for colu in range(0,n):
if row==colu or row==0 or colu==n-1:
print("* ",end="")
else:
print(end=" ")
print()
Thanks ❤️
ОтветитьHi, what if we want space between the each star in row and get the hollow right angle triangle. Can you explain it
Ответитьn = int(input())
for row in range(0,n):
for col in range(0,n):
if row == 0 or col == (n-1) or row == col:
print("*",end="")
else:
print(end=" ")
print()
not getting proper output
good explanation
ОтветитьHere is the correct code below 👇
N = int(input())
for row in range(0,N):
for col in range(0,N):
if col == N-1 or row == 0 or col == row:
print("*",end=" ")
else:
print(" ",end=" ")
print()
Thanks a lot Amula you are the best,
Update code:
rows = int(input("Enter Numbers of rows:> "))
for row in range(rows):
for col in range(rows):
if row == 0 or col == rows - 1 or row == col:
print('*', end=' ')
else:
print(' ', end=' ')
print()
I like your voice..😍and explanation take a bow.
Ответитьi tried your code i got an inappropriate output
can you suggest, mistake made by me ....
n = int(input())
for row in range(0,n):
for col in range(0,n):
if row==0 or col==(n-1) or row==col:
print('* ',end="")
else:
print(end=" ")
print()
if i want space after each star how can i write the program
ОтветитьUsing one for loop and r.just:
n = int(input("Enter number of rows: "))
for i in range(1,n+1):
if i ==1:
print("*"*n)
elif i == n:
print("*".rjust(n," "))
else:
print("*".rjust(i, " ") + "*".rjust(n-i," "))
Please make video in hindi
ОтветитьThank you so much, your content is helping me a lot these days👏👍
Ответитьcan you do this
Right Angled Triangle - 3
Given an integer number N as input. Write a program to print the right-angled triangular pattern of N rows as shown below.
Input
The first line of input is a positive integer.
Explanation
For example, if the given number is 5, the output should be
Sample Input 1
Sample Output 1
- - - - - -
| /
| /
| /
| /
But I am getting this ****
*
*
*
*
for row in range(5) :
for col in range(5) :
if row==0 or col==4 or row==col:
print("*", end=" ")
else:
print(end=" ")
print()
nice 👍🏻👍🏻👍🏻
ОтветитьBest teaching👍
ОтветитьHow about parallelogram shape? can it also be constructed?
ОтветитьHi Amulya,
The above mentioned program doesn't work. Here's the program. Could you check?
n= int(input("enter the no of rows:"))
for r in range(0,n):
for c in range(0,n):
if r==0 or c==(n-1) or r==c:
print('*', end = '')
else:
print(end='')
print()
Thanks!
Program will be not run python 3.0
Ответитьcorrect code
n = int(input('Enter an integer number: '))
for rows in range(n):
for columns in range (n):
if rows==0 or columns==(n-1) or rows==columns:
print('*', end='')
else:
print(end=' ')
print()
hi , 1stly thanks for teaching in such a brilliant way. U made python very easy to understand. Now my query is that if we write print(end="*") instead of print("*",end=""), we get the same result result then why don't we write in the first way?
ОтветитьCan u please make video for practice programs in Dictionary... I want to learn how to write programs in dictionary from u... U explain really good... Please help.!
ОтветитьBest tutor...
ОтветитьNice teaching...
ОтветитьHi can u send me same program with no space in between but in same shape
Ответитьit does not work...... the last line not come and plz if possible in while loop then plz give me some idea
Ответитьoutput is totally diff. can you plz resolve it .
ОтветитьIts not working plz provide proper code
ОтветитьThis logic doesn't works I am not getting require out put
Ответитьhey there, could you please upload a video on how to print stars in shape of right angle with no hollow space?
ОтветитьHi Amulya ur beautiful teaching
Ответитьplease explain the else part space because they work when the if condition is wrong in this code if condition is not wrong please explain line by line working
Ответитьplease explain the else part space because they work when the if condition is wrong in this code if condition is not wrong please explain line by line working
Ответитьthank you mam
Ответить