@Larz - only one
@ichabood - you need
:-)
not
will do@ichabood - you need
not
:-)
def larz(result): return not not result def code_raker(result): if result == 0: return True else: return False def ichabood(result): return bool(result) print('x==0') x=0 print('CodeRaker: {}'.format(code_raker(x))) print('Larz: {}'.format(larz(x))) print('Ichabood: {}'.format(ichabood(x))) print('\nx==1') x=1 print('CodeRaker: {}'.format(code_raker(x))) print('Larz: {}'.format(larz(x))) print('Ichabood: {}'.format(ichabood(x)))
Output:x==0
CodeRaker: True
Larz: False
Ichabood: False
x==1
CodeRaker: False
Larz: True
Ichabood: True
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