Skip to content

Instantly share code, notes, and snippets.

@DiogenesAnalytics
Forked from RagingTiger/quine.py
Created December 15, 2023 18:46
Show Gist options
  • Save DiogenesAnalytics/158d2c951b1bab4d2a933d61a4d349eb to your computer and use it in GitHub Desktop.
Save DiogenesAnalytics/158d2c951b1bab4d2a933d61a4d349eb to your computer and use it in GitHub Desktop.
Lex Fridman - Quine Example
# Ref: https://youtu.be/a-zEbokJAgY
# quine
s='s=%r;print(s%%s)';print(s%s)
# interactive intron
t='';s='t=input()or t;print(f"t={repr(t)};s={repr(s)};exec(s)#{t}")';exec(s)#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment