+ 1
Python for beginners, 11 code project leaderboard
I tried: print ( ‘1. \n2. \n3. \n4 \n5. \n6. \n7. \n8. \n9.’ ) And the same thing but without spaces between the previous number and \n. Each time it came out looking how it should, a list of 1.-9. But it said I got it wrong. Please help.
4 Antworten
+ 2
here is what I meant above since I am getting down voted.
print ("1.\n2.\n3.\n4.\n5.\n6.\n7.\n8.\n9.")
0
I used a for loop instead. Like this:
for i in range(1,10):
print(str(i) + ".")
Much less code, but you need to understand how for loops and type conversion works.
- 2
print("1.""\n"
"2." "\n"
"3."
"\n" "4." "\n" "5." "\n" "6." "\n""7." "\n" "8." "\n" "9.");
#Trythisinstead
- 3
don't add spaces between numbers.
1.\n2 not 1. \n2
missing . after 4
use " " or ' ' not ‘ ’