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.""")
9 Answers
+ 4
Delicate Cat no, we have to remove it :(
+ 1
Javad HD since in the instructions it is mentioned to output numbers followed by a dot
+ 1
Delicate Cat thanks, will try for sure!
+ 1
Simba merci, it works for me! Just removed the space
0
Why you put a "." after each number? remove the "." and try again!
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}.")
0
Simba Doesn't SL automatically trim the trailing space in each line?
0
so may be you should remove the " " (spaces)
"1. \n2. \n" should be written as "1.\n2.\n"