0

How to solve it....?

You need to make a program for a leaderboard. The program needs to output the numbers 1 to 9, each on a separate line, followed by a dot: 1. 2. 3. ...

23rd Jun 2021, 12:59 PM
Md Shihab Shahriar Rashu
Md Shihab Shahriar Rashu - avatar
7 Respuestas
+ 2
Md.Shihab Shahriar Rashu in both your code you put space after each dot... in second one that almost invisible, as in final output... however, there are unexpected spaces in final output that are detected by test as not expected right output (test check is not done by a human looking at your output, but by a program checking the outputed string is exactly what's expected)... anyway, your first code has an unexpected space at start of each line also, and an unexpected new line at start of your second code ;P this one should pass the test: print ('1.\n2.\n3.\n4.\n5.\n6.\n 7.\n8.\n9.')
24th Jun 2021, 12:23 AM
visph
visph - avatar
+ 1
Where is your try...?
23rd Jun 2021, 1:00 PM
Jayakrishna 🇮🇳
+ 1
There is no need of space. It asked to print number followed by dot in line by line. So remove all spaces in that string.
23rd Jun 2021, 1:08 PM
Jayakrishna 🇮🇳
+ 1
I've got it's answer....🙂 here it is: print(""" 1. 2. 3. 4. 5. 6. 7. 8. 9. """)
23rd Jun 2021, 1:40 PM
Md Shihab Shahriar Rashu
Md Shihab Shahriar Rashu - avatar
+ 1
Here's a simpler way: for i in range(1, 10): print(f"{i}.") # Hope this helps
24th Jun 2021, 9:00 AM
Calvin Thomas
Calvin Thomas - avatar
0
I wrote like this but didn't print (' 1. \n 2. \n 3. \n 4. \n 5. \n 6. \n 7. \n 8. \n 9. ')
23rd Jun 2021, 1:03 PM
Md Shihab Shahriar Rashu
Md Shihab Shahriar Rashu - avatar
0
Which language? For me it is working
23rd Jun 2021, 1:33 PM
Nanda Balakrishnan