Last active
August 30, 2019 16:10
-
-
Save amigojapan/6de478bc582a9ba5433963d746cf1f5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def thisIsALie(currentValue,counter,depthToGiveUp): | |
if(counter==depthToGiveUp): | |
quit() | |
if(currentValue): | |
print("this is not a lie") | |
else: | |
print("this is a lie") | |
currentValue= not currentValue | |
return thisIsALie(currentValue,counter+1,depthToGiveUp) | |
initialValueTrue=True; | |
depthToGiveUp=random.randint(1,15) | |
thisIsALie(initialValueTrue,0,depthToGiveUp) | |
##output follows | |
$ python liarsparadox.py | |
this is not a lie | |
this is a lie | |
this is not a lie | |
this is a lie | |
this is not a lie | |
this is a lie | |
this is not a lie | |
this is a lie | |
this is not a lie |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment