+ 2
I hope you can help me with this code please?
The question is in the code https://code.sololearn.com/czUxXZJoVZzk/?ref=app
5 ответов
+ 7
There are many ways you can do that, the first one, as continuation to your code, is to remove the last to simply print without end='.' when j==i, here is the code (first link)
The second method is to use lists, which is easier (second link)
https://code.sololearn.com/ciqm8Yb796uh/?ref=app
https://code.sololearn.com/ccbost7wsmR9/?ref=app
+ 2
Thank you very much bro i understand
0
Mirielle🐶 [Inactive] that's what I'm getting when I run my code and Jan Markus's code ^^", actually your code only outputs the input
0
Mirielle🐶 [Inactive] okay now I see the confusion. No, the input is not 12345, but rather 5 only. In line 11 of the original code, you can see he gave a test input, n=5, which means n takes only the last number of the last line
0
n = 4
for i in range(1, n+1):
for j in range(1, i+1):
print(j, end=".")
print()