Python Basics Ascending Number Triangle Using Itertools Count Method

preview_player
Показать описание
Learn how to build a number triangle with ascending numbers using for loops and count from itertools

twitter: @python_basics

#pythonprogramming #pythonbasics #pythonforever
Рекомендации по теме
Комментарии
Автор

from itertools import count as ct

start = ct(1, 2)

num = ct(1)

for i in range(3):
for k in range(3 - i, 0, -1):
print(' ', end='')
for j in range(next(start)):
print(next(num), end=' ')
print()

again I like yours better! Thanks!

blueicewolfgmail
Автор

very much kind of you sir
thanks for your help
once again thankyou

santhosh_
Автор

Sir this is also right but it should execute the number of rows specified by the user so can you please make a change in this pattern

santhosh_