Python Pattern Programs - Printing Stars in Z Shape

Python Pattern Programs - Printing Stars in Z Shape

Amulya's Academy

6 лет назад

20,470 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@pannagabm2100
@pannagabm2100 - 21.09.2023 16:21

Thank you mam.. Very helpful and always greatfull😊

Ответить
@user-ds2tg1io9d
@user-ds2tg1io9d - 24.03.2023 11:50

for row in range(6):
for col in range(6):
if row==0 or row==5 or (row==5-col):
print("*", end=" ")
else:
print(end=" ")
print()

Ответить
@sajalkumar3018
@sajalkumar3018 - 09.01.2023 15:59

Can't thank you enough for such easy to learn tutorials, there are some basics that some teachers choose skip assuming that the students would know of them but because of those missing minor details there was a huge gap in my logics which was perfectly filled by your tutorials. Thanks again!!👍

Ответить
@laxmannallala3835
@laxmannallala3835 - 18.12.2022 21:32

Super👌👌👌

Ответить
@chethangopal5534
@chethangopal5534 - 22.03.2022 23:02

Thank you so much Amulya Ji! really this course helped me to gain confidence and move further

Ответить
@surajtaru2499
@surajtaru2499 - 21.03.2022 04:47

thanks a lot amul, cause of you now I can print a-z pattern.

Ответить
@TJ-wo1xt
@TJ-wo1xt - 13.09.2021 18:15

gr8 explanation

Ответить
@reddaboinavasista4166
@reddaboinavasista4166 - 20.04.2021 22:13

This video is great and really helpful.
Can I know the code for Z pattern using a single loop.

Ответить
@shivshankarguptashiv4440
@shivshankarguptashiv4440 - 12.10.2020 12:32

mam please javascript kaisha hoga karke dona A type print please sir,mam

Ответить
@hardikambaliya6622
@hardikambaliya6622 - 08.07.2020 20:20

for row in range(6):
for col in range(6):
if ((row==0 or row==5)) or ((col+row==5 and 0<row<5)):
print('*',end='')
else:
print(end=' ')
print()
For Z no need any extra variable please try. Please try this one and say if it is in right manner or not.

Ответить
@tejasreem3712
@tejasreem3712 - 23.06.2020 08:25

n=int(input ("enter no of rows "))
For i in range (0,n):
For j in range (0,n):
If row==O or row == n-1 or row + col ==n-1 :

Print ("*",end="")
Else:
Print (end =" ")


Is it crct mam ?

Ответить
@shubhgarg3199
@shubhgarg3199 - 03.06.2020 21:28

Ur voice is so attractive

Ответить
@sunilpatil31914
@sunilpatil31914 - 03.06.2020 08:21

Thank you so much ma'ma

Ответить
@harshvardhan6087
@harshvardhan6087 - 13.03.2020 10:41

Aree, If Statement True Hue ... First n last row * sey bhar jaayngi ... But bich wale ka kya .. if true hui , to elif exicute hi nahi Hoti toh bich ke part ka kya

Ответить
@shrutism6839
@shrutism6839 - 24.01.2020 13:30

Mera output galat aa rha hai....want to do ...pls help

Ответить
@harikrishna6749
@harikrishna6749 - 09.08.2019 08:01

How about this?
for row in range (0,n):
for col in range (0,n):
if (row==0) or (row==n-1) or (row+col==n):
Print("*", end=" ")
else:
print(" ")

Ответить
@sanjibkumarjena5556
@sanjibkumarjena5556 - 09.07.2019 22:40

num_stars = 6
for i in range(num_stars):
if(i==0 or i == num_stars-1):
print("*" * num_stars)
else:
print(" "*(num_stars-(2+i)) + "*" + " "*(i+1))

Ответить
@Artistry-1517
@Artistry-1517 - 10.04.2019 19:06

Ma'am i need ur help plzz help me!!

Ответить
@1rajuindia
@1rajuindia - 26.03.2019 15:18

Thank u very much for your ideas. I really like your way of presentation. All the best and and keep give ore sample then and there. Thanks and regards, M. Raju

Ответить
@increadibleangel7980
@increadibleangel7980 - 11.07.2018 14:20

thank u,and
you voice is sweet :)

Ответить
@SOLAR19452011
@SOLAR19452011 - 03.12.2017 13:21

there is easier way to work out
if row == 0 or row == 5 or row + col == 5:

Ответить