+ 3
How do people know what to input exactly? if it happens to them not to read my code completly first.
When I post a program of mine, I don't expect people to input the correct quantity of numerical data which the program asks. For example this... https://code.sololearn.com/cwlfWRM675DH/?ref=app
3 Réponses
+ 3
It helps to tell people what to input with a multiline comment at the beginning of your code. To go even further, you can also write an example input in that same comment.
+ 2
Leaving a short and easy instruction at the top is a good idea. To make sure, you could write it again as a comment or in your post (when it's an assignment).
Still many people will not read it and just hit RUN, so I think it is a good idea to set default values that are used in that case, so that your program doesn't fail no matter what the user does.
+ 1
Add input-handlers, exception-handlers, Error handlers