- 5
What's wrong with this code
print('1. \n2. \n3. \n4. \n5. \n6. \n7. \n8. \n9.')
45 Respostas
+ 23
print("""
1.
2.
3.
4.
5.
6.
7.
8.
9.""")
solve it using this
please upvote
+ 3
and that's what you get...
+ 2
No I am in Sololearn module project
+ 2
Sololearn only
+ 2
the right answer for your question is here:
https://www.sololearn.com/Discuss/2688080/?ref=app
you need to remove spaces from your string:
print('1.\n2.\n3.\n4.\n5.\n6.\n7.\n8.\n9.')
+ 1
1.
2.
3.
4.
5.
6.
7.
8.
9.
+ 1
Not running.
+ 1
where and how are you trying to run it?
+ 1
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.
...
+ 1
That's the problem.
+ 1
Sololearn
+ 1
yes, I guessed the problem... (and I think they expect you to write a loop ^^)
+ 1
It's a module project after lesson
+ 1
But where
+ 1
They also give a hint.You can use the \n newline character to create line breaks, or, alternatively, create the desired output using three double quotes """.
+ 1
you should be in a python code playground, where you have to press the run button to run your code:
https://code.sololearn.com/c89gMdkSQTAm/?ref=app
and you're right: they just expect you to output new lines :)
(I don't know why suddently I wasn't able to post in your thread for some times)
+ 1
But what about my project.
+ 1
How can I run it
+ 1
like you can run the code link I've posted (after you're clicking on it)
+ 1
Please explain I didn't understand.