- 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.
39 Antworten
+ 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.
+ 1
See if that will work...
0
I tried..I get 3 lines and it is 9 marks.
0
Oh...k I understood...
Give me a second... I'll try something else
0
Okay
0
It does not work
0
What's the error?
0
Bad input on line 3
0
Which code editor r u using?
0
Programming Hero
0
Hmm... Try on sololearn's code editor
It's called code playground
0
Btw... I suppose it's for school...right?
The assignment...??
0
I did so those 3 lines worth 9 marks?
0
If you have a laptop or a computer, try using visual studio code
0
Is it normal when it says enter an input?
0
As long as you answer the question... Which says, that they want those numbers on one line
0
Thank you
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
0
I only know one way