+ 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

21st Dec 2018, 12:44 AM
Tecolote Come Elote
Tecolote Come Elote - avatar
4 odpowiedzi
+ 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.
21st Dec 2018, 12:52 AM
Zeke Williams
Zeke Williams - avatar
+ 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.
21st Dec 2018, 9:42 AM
HonFu
HonFu - avatar
+ 1
Add input-handlers, exception-handlers, Error handlers
22nd Dec 2018, 11:16 AM
Pascal Pizzini
Pascal Pizzini - avatar