Nested Loop Python

后端 未结 13 2264
一个人的身影
一个人的身影 2020-12-09 23:40
count = 1
for i in range(10):
    for j in range(0, i):
        print(count, end=\'\')
        count = count +1
    print()
input()

I am writing a

13条回答
  •  借酒劲吻你
    2020-12-10 00:29

    Change print(count, end='') to print(i + 1, end='') and remove count. Just make sure you understand why it works.

提交回复
热议问题