0

Python - End of module project - Strings - Question on solution

Hey, I'm entering the code in the project and the output matches but it says the solution isn't correct .. You have to create a leader board like 1. 2. 3. 4. 5. 6. 7. 8. 9. And the code I created was https://code.sololearn.com/cG52GNOo5dnJ/?ref=app Am I going wrong somewhere?

30th Apr 2021, 7:51 AM
Matt
Matt - avatar
8 Antworten
+ 5
Remove the space between `.` and `\` print("1.\n2.\n3.\n4.\n5.\n6.\n7.\n8.\n9.")
30th Apr 2021, 8:39 AM
Simba
Simba - avatar
+ 3
Matt Remove ALL the spaces in your string
30th Apr 2021, 9:40 AM
ChaoticDawg
ChaoticDawg - avatar
+ 3
Still there is a space between \n8. and \n9. print("1......\n8.\n9.")
30th Apr 2021, 11:21 AM
Simba
Simba - avatar
+ 3
Thanks for this, I couldn't see the gap on the app 😶 Thanks, working now :)
30th Apr 2021, 4:05 PM
Matt
Matt - avatar
+ 2
You have to use loops to solve this, for i in range(1,10): print(i,end='.\n') Tbh, I don't know why your sol fails over this question 🤷‍♂️
30th Apr 2021, 7:53 AM
Aditya
Aditya - avatar
+ 1
Thanks for the quick reply ! I haven't learnt about loops yet, just on Python for beginners and just finished strings so I'd have thought /n would create the line break it is looking for
30th Apr 2021, 7:55 AM
Matt
Matt - avatar
0
Sadly not, just tried: print("1.\n2.\n3.\n4.\n5.\n6.\n7.\n8. \n9.") Still coming up with a fail
30th Apr 2021, 9:25 AM
Matt
Matt - avatar
0
Mas chulo: def numbers(number): for x in range(1, number): print(str(x) + '.') numbers(10)
8th Sep 2021, 9:50 PM
Oriol Centelles Ruiz
Oriol Centelles Ruiz - avatar