+ 1

good code?

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. for this problem this code is a good code? print("""1. 2. 3. 4. 5. 6. 7. 8. 9.""")

6th Apr 2021, 1:56 PM
Erfan heydari
Erfan heydari - avatar
3 Answers
+ 7
Rainbow , nice code for this task! but i have my doubts that the op has any benefit as he is still in the learning process of python. just giving a code without any comments is difficult to understand. from my point of view, a sample with a for loop and also some explanations will fit the needs of the op in a appropriate way. Pleas do not misunderstand my post. thanks!
6th Apr 2021, 3:13 PM
Lothar
Lothar - avatar
+ 8
Yes, your code can get better if you use a for loop instead of typing all the numbers.
6th Apr 2021, 2:31 PM
Pranav
Pranav - avatar
+ 1
i think it can better than
6th Apr 2021, 2:03 PM
Erfan heydari
Erfan heydari - avatar