Python Pattern Program - Printing stars and Numbers in Diamond Shape | Right Triangle Shape

preview_player
Показать описание
In this Python Pattern Printing Programs video tutorial you will learn how to print numbers and stars in diamond shape in detail.

Concept Timings:
8:42:00 Printing Numbers in Right Triangle Shape Pattern 2
13:24:00 Printing Numbers in Right Triangle Shape Pattern 3
17:10:00 Printing Numbers in Right Triangle Shape Pattern 4

For more free tutorials on computer programming
Рекомендации по теме
Комментарии
Автор

By the way i love your voice mam.
and for the last part of this problem, you changed initial row range. So it obvious that many people might get confused .But i got some different solution for that as you taught us . And " HERE IS WHAT I COME UP WITH":


n=int(input("Enter the no. of rows:\n"))


for i in range(n):
m=i+1
#print space
for j in range(n-i-1):
print(" ", end=" ")
#print star
for j in range(i+1):
print("*", end=" ")
print(end=" ")
for j in range(i+1):
print(m+j, end=" ")
m+=1
print()
print()
for i in range(n):

#print space
for j in range(i):
print(" ", end=" ")
#print number
for j in range(n-i):
print(n-j, end=" ")
print(end=" ")
for j in range(n-i):
print(2*(i+j)+1, end=" ")

print()

phoenixmix
Автор

A-M-A-Z-I-N-G!!! Most didactic video I have ever seen of python (for loops)

Igor-vkfl
Автор

can you remember me when you get famous?

darshilkumar
Автор

A P Q R
A B Q R
A B C R
A B C D
How to write code to print this pattern... Please tell me anyone.

mepromptengineer