+ 1
Python for beginners course, leaderboard project
x = "1. \n2. \n3. \n4. \n5. \n6. \n7. \n8. \n9." print(x) #It failed the test case and say no input. PLZ help.
10 Réponses
+ 16
You need to remove the space between '.' and '\'
x = "1.\n2.\n3....."
+ 4
x = "1.\n2.\n3.\n4.\n5.\n6.\n7.\n8.\n9."
print(x)
or
print("""
1.
2.
3.
4.
5.
6.
7.
8.
9.
""")
+ 3
print("""
1.
2.
3.
4.
5.
6.
7.
8.
9.
""")
+ 3
for i in range(1,10):
print(str(i) + ".")
it is the easiest option for a loop :)
+ 1
Thanks Simba
Was having trouble with it too
0
print("""1.\n2.\n3.\n4.\n5.\n6.\n7.\n8.\n9. """)
0
I know this is old, but it keeps marking it as wrong when I input this:
print("""1.
2.
3.
4.
5.
6.
7.
8.
9.""")
What’s wrong with this answer?
0
Instead of that you can use this
print ("""1.
2.
3.
4.
5.
6.
7.
8.
9.""")
- 1
Print("1.
2.
3.
4.
5.
6.
7.
8.
9")
- 1
a=1
while a < 10:
print(str(a)+".")
a=a+1
it worked