I hope you can help me with this code please? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I hope you can help me with this code please?

The question is in the code https://code.sololearn.com/czUxXZJoVZzk/?ref=app

7th Nov 2019, 2:08 AM
At&M
At&M - avatar
5 Answers
+ 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
7th Nov 2019, 2:16 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
Thank you very much bro i understand
7th Nov 2019, 2:21 AM
At&M
At&M - avatar
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
7th Nov 2019, 10:29 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
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
7th Nov 2019, 10:45 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
0
n = 4 for i in range(1, n+1): for j in range(1, i+1): print(j, end=".") print()
8th Nov 2019, 8:39 AM
alex_shchegretsov
alex_shchegretsov - avatar