Python for beginners (Code Project) -> I got correct output but still says "try again"..what should I do? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python for beginners (Code Project) -> I got correct output but still says "try again"..what should I do?

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. You can use the \n newline character to create line breaks, or, alternatively, create the desired output using three double quotes """. This is how I solved first: print ("1. \n2. \n3. \n4. \n5. \n6. \n7. \n8. \n9.") Then tried this: print ("""1. 2. 3. 4. 5. 6. 7. 8. 9.""")

25th Aug 2021, 5:19 AM
Bahar Hasanova
Bahar Hasanova - avatar
9 Answers
+ 4
Delicate Cat no, we have to remove it :(
25th Aug 2021, 6:12 AM
Simba
Simba - avatar
+ 1
Javad HD since in the instructions it is mentioned to output numbers followed by a dot
25th Aug 2021, 5:57 AM
Bahar Hasanova
Bahar Hasanova - avatar
+ 1
Delicate Cat thanks, will try for sure!
25th Aug 2021, 5:58 AM
Bahar Hasanova
Bahar Hasanova - avatar
+ 1
Simba merci, it works for me! Just removed the space
25th Aug 2021, 6:07 AM
Bahar Hasanova
Bahar Hasanova - avatar
0
Why you put a "." after each number? remove the "." and try again!
25th Aug 2021, 5:39 AM
Javad HD
Javad HD - avatar
0
Bahar Hasanova According to me, your code works just fine, although a better alternative would be to use a loop: for i in range(1, 10): print(f"{i}.")
25th Aug 2021, 5:42 AM
Calvin Thomas
Calvin Thomas - avatar
0
Simba Doesn't SL automatically trim the trailing space in each line?
25th Aug 2021, 6:05 AM
Calvin Thomas
Calvin Thomas - avatar
0
so may be you should remove the " " (spaces) "1. \n2. \n" should be written as "1.\n2.\n"
25th Aug 2021, 6:15 AM
Javad HD
Javad HD - avatar