Jul-10-2019, 05:09 AM
Suggestion regarding code.
Code should be DRY (don't repeat yourself). Every time you find yourself writing repeating rows you should stop and think what should you do differently. Don't use Python as typing machine, it's programming language.
You can ask user input with loop (requires 3.6 <= Python as f-string is used):
Code should be DRY (don't repeat yourself). Every time you find yourself writing repeating rows you should stop and think what should you do differently. Don't use Python as typing machine, it's programming language.
You can ask user input with loop (requires 3.6 <= Python as f-string is used):
>>> answers = list() >>> for i in range(5): ... answers.append(int(input(f'Enter total of 5 numbers ({i+1}/5): '))) ... Enter total of 5 numbers (1/5): 4 Enter total of 5 numbers (2/5): 5 Enter total of 5 numbers (3/5): 5 Enter total of 5 numbers (4/5): 3 Enter total of 5 numbers (5/5): 4 >>> answers [4, 5, 5, 3, 4]
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.