+ 1
Exercice
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 """. Voici ce que j'ai essayé : Print ( 1. \n 2. \n 3. \n 4. \n 5. \n 6. \n 7. \n 8. \n 9. )
6 odpowiedzi
+ 2
Your code has three issues:
1. Python is case sensitive, so it has to be "print", not "Print".
2. You're printing a string, so you need to use quotation marks.
3. Python prints the spaces. So, while they do make your code more readable, they screw up the result.
print("1.\n2.\n3.\n4.\n5.\n6.\n7.\n8.\n9.")
+ 2
➵Chloe it's for a course project, so the result has to be exactly what sololearn expects, so no additional spaces, etc. But points 1 and 2 are necessary for the code to run without errors.
+ 2
Simon Sauter oh, I see. I thought it was just a project and the print statement was a product of autocorrect of some sort. Thanks for the clarification!
+ 2
J'ai oublié de mettre les guillemets ici. Sinon dans mon programme je l'ai mis. Je crois que mon véritable problème ce sont les espaces.
Si vous serez disponibles pour m'aider, je vais donner des exercices et avec des propositions.
Merci beaucoup pour vos éclaircissements !
+ 1
I don't see the issue, the code works fine?