It's unclear what your code is supposed to do and in any case we can comment on your code/implementation and we can hardly suggest new features. That's why I will comment on your signature.
And some comments on your "main" code
dad_has_cigs
is obviously abool
. Comparing it toTrue
andFalse
is redundant.while dad_has_cigs:
andif not dad_has_cigs:
is enough.
- If
dad_has_cigs
isTrue
and you enter the loop, there is no was that consecutiveif dad_has_cigs == False:
condition to be evaluatedTrue
and execute the body. You never change the value ofdad_has_cigs
so it will never be executed, unless it's considered to be global variable and changed independently in different thread (i.e. dad smokes in a different threat).
- Indentation is unclear, but I guess last 3 lines are indented.
- I hope this comment will not be taken too seriously, but some lessons will be learnt :-)
And some comments on your "main" code
- Cryptic [one-letter] names.
- No comments
- Mix of GUI and logic
- heavy use of global variables
- repetitive code, in need of refactoring
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs