Skip to content

Instantly share code, notes, and snippets.

@amigojapan
Last active August 30, 2019 16:10
Show Gist options
  • Save amigojapan/6de478bc582a9ba5433963d746cf1f5b to your computer and use it in GitHub Desktop.
Save amigojapan/6de478bc582a9ba5433963d746cf1f5b to your computer and use it in GitHub Desktop.
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