It was great thanks really. One more and last question:
if you want to control user inputs which are expected as comma separated like 1,2,3,4
how would you check this? I was originally planning to check the numbers between 0 and 7 for the dice game that's why I asked the question.
I have a few thoughts already which one do you think is better analytic approach?
1. If there is an input, you always expect odd number of input length because:
1,2,3 -- len(input) = 5
1 -- len(input) = 1
1,2,3,4,5 len(input) = 9
2. Or length of used commas in the input will be also half of the total input -1:
1,2,3,4,5 len(input) = 9
len(re.findall(',', keep_input)) = (9-1)/2
I also check, before these two conditions, if the user input makes sense, if it is pure number and commas, if anything else provided etc. I don't accept and request once more input from user that is it.
Note: after finishing the game I will share it with you guys to give idea to everyone. At the moment I'm trying to normalise user input, filter it and reject etc. The main part of code (success cases working pretty well).
Kind Regards