+ 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.

21st Sep 2021, 1:51 PM
Braydn Rea
4 Answers
+ 2
here is what I meant above since I am getting down voted. print ("1.\n2.\n3.\n4.\n5.\n6.\n7.\n8.\n9.")
22nd Sep 2021, 11:40 PM
Bahha┣
Bahha┣ - avatar
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.
4th Sep 2022, 1:47 PM
Luna Skystar
Luna Skystar - avatar
- 2
print("1.""\n" "2." "\n" "3." "\n" "4." "\n" "5." "\n" "6." "\n""7." "\n" "8." "\n" "9."); #Trythisinstead
16th Jul 2022, 4:29 PM
shiwana
shiwana - avatar
- 3
don't add spaces between numbers. 1.\n2 not 1. \n2 missing . after 4 use " " or ' ' not ‘ ’
21st Sep 2021, 2:07 PM
Bahha┣
Bahha┣ - avatar