How do I write this program?I am a beginner. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
- 3

How do I write this program?I am a beginner.

Write a program in python that allows a user to enter a number and display the numbers on a single line starting from 1 until the entered number.

13th Apr 2022, 1:36 PM
Tshiamo
39 Respuestas
+ 1
Understanding the question: A program that takes a number from the user Then displaying an output from 1 upto that number entered by the user I would encourage you to try it first.
13th Apr 2022, 1:41 PM
Jolen Mascarenhas
+ 1
See if that will work...
13th Apr 2022, 2:03 PM
Jolen Mascarenhas
0
I tried..I get 3 lines and it is 9 marks.
13th Apr 2022, 1:42 PM
Tshiamo
0
Oh...k I understood... Give me a second... I'll try something else
13th Apr 2022, 1:48 PM
Jolen Mascarenhas
0
Okay
13th Apr 2022, 1:52 PM
Tshiamo
0
It does not work
13th Apr 2022, 2:06 PM
Tshiamo
0
What's the error?
13th Apr 2022, 2:06 PM
Jolen Mascarenhas
0
Bad input on line 3
13th Apr 2022, 2:13 PM
Tshiamo
13th Apr 2022, 2:17 PM
Jolen Mascarenhas
0
Which code editor r u using?
13th Apr 2022, 2:17 PM
Jolen Mascarenhas
0
Programming Hero
13th Apr 2022, 2:19 PM
Tshiamo
0
Hmm... Try on sololearn's code editor It's called code playground
13th Apr 2022, 2:19 PM
Jolen Mascarenhas
0
Btw... I suppose it's for school...right? The assignment...??
13th Apr 2022, 2:20 PM
Jolen Mascarenhas
0
I did so those 3 lines worth 9 marks?
13th Apr 2022, 2:21 PM
Tshiamo
0
If you have a laptop or a computer, try using visual studio code
13th Apr 2022, 2:21 PM
Jolen Mascarenhas
0
Is it normal when it says enter an input?
13th Apr 2022, 2:21 PM
Tshiamo
0
As long as you answer the question... Which says, that they want those numbers on one line
13th Apr 2022, 2:22 PM
Jolen Mascarenhas
0
Thank you
13th Apr 2022, 2:25 PM
Tshiamo
0
To be honest, there is not just one way to program a particular code for a particular task To make it simple, suppose in maths, u need to get an answer 20 so you have many options to get that 20. Such as, 2+2+2+2+2+2+2+2+2+2 (this is the long way) Programmers always use the short way which saves time, money and resources Here, we could have easily reached that answer by 2×10 So, the conclusion is that there are various ways one can reach a particular answer. Make sure whatever the question asks is answered
13th Apr 2022, 2:25 PM
Jolen Mascarenhas
0
I only know one way
13th Apr 2022, 2:26 PM
Tshiamo