+ 12
This program is not running.what should I do now?
print('1. \n2. \n3. \n4. \n5. \n6. \n7. \n8. \n9.')
77 Respuestas
+ 14
Sathe Prerana Satish just remove space between them
+ 9
It works for me
https://code.sololearn.com/culuCMEcXvgC/?ref=app
+ 7
This is another way.
for i in range(9):
print(str(i+1)+'.')
+ 5
It won't show any error because only the space is missing.
+ 5
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
........
I think this is ur required output, right?
+ 5
using System;
namespace PascalTriangleDemo {
class Example {
public static void Main() {
int rows = 5, val = 1, blank, i, j;
Console.WriteLine("Pascal's triangle");
for(i = 0; i<rows; i++) {
for(blank = 1; blank <= rows-i; blank++)
Console.Write(" ");
for(j = 0; j <= i; j++) {
if (j == 0||i == 0)
val = 1;
else
val = val*(i-j+1)/j;
Console.Write(val + " ");
}
Console.WriteLine();
}
}
}
}
+ 4
Which Language ?
+ 4
+ 4
Thanks Arensic🙏
+ 4
For your help 🙏
+ 4
It only didn't work first time because the extra spaces caused the automated test to fail. Otherwise it was correct.
+ 4
I think saying Hi should be done in DM or personal feed 😁.
+ 4
Mam how is it possible from morning onwards I was suggesting u the same and it didn't work all of a sudden it now worked for u. I really wonder.
+ 4
Wai a min I will post my screenshot.
+ 4
U can see the test case is passed with required output.
+ 4
Print ("""1.
2.
3.
4.
5.
6.
7.
8.
9."""")
+ 4
You are most welcome. By the way keep coding. Never ever quit programming.
+ 3
I also create just like this code but it is not running.