- 2

Please how can I list 1-9 to in Python on a new line each

5th Feb 2021, 11:00 AM
Abubakar Sadiq Adam
Abubakar Sadiq Adam - avatar
5 Answers
+ 2
Abubakar Sadiq Adam ,Angelo , visph, Infinity , please help us to keep sololearn what it is made for: It is a self-learning platform. So this means, that we should avoid giving codes when people ask for this, before they have done a try by themselves and before they have present it here. It looks really helpful when you post a code as you did, but it does not help the OP. This will be a copy and paste - and the coding skills and problem solving ability will not grow. the op has done appr. the half of the python beginners tutorial, so i think he should be able to solve this task. if not, op should repeat parts of the tutorial. What we should do is to give HINTS or COMMENTS how to solve the task. Thanks for your understanding.
5th Feb 2021, 2:35 PM
Lothar
Lothar - avatar
+ 1
print("\n".join(map(str,range(1,10))))
5th Feb 2021, 12:49 PM
visph
visph - avatar
+ 1
Lothar the only part where I agree with you is that I should have waited for him to show his work.
5th Feb 2021, 3:27 PM
Angelo
Angelo - avatar
+ 1
Okay thank you all
18th Feb 2021, 12:04 AM
Abubakar Sadiq Adam
Abubakar Sadiq Adam - avatar
0
[print(i) for i in range(1, 10)] Or for i in range(1, 10): print(i)
5th Feb 2021, 11:30 AM
Angelo
Angelo - avatar