Anonymous user
Execute HQ9+/Python: Difference between revisions
no edit summary
m (Fixed syntax highlighting.) |
imported>Katsumi No edit summary |
||
Line 3:
This [[Python]] example implements 'H', 'Q', '9' and '+'.
<syntaxhighlight lang="python">
import sys
def hello():
print
def quine():
print
def bottles():
for i in range(99,2,-1):
print
print
print
print
print()
print
print
print
print
print()
print
print
print
print
print()
print
print
print
print
print
def incr():
Line 41 ⟶ 42:
if len(sys.argv) != 2:
print
sys.exit(1)
else:
Line 49 ⟶ 50:
s = open(f,"r")
except IOError, e:
print
sys.exit(1)
Line 65 ⟶ 66:
for i in src.lower():
if i in dispatch:
dispatch[i]()
</syntaxhighlight>
|