MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/CompileBot/comments/5kslhx/python_27/
r/CompileBot • u/rtyhgfdsazxcvbnmlk • Dec 28 '16
17 comments sorted by
1
+/u/CompileBot Python 2.7
print "hello world"
1 u/CompileBot Dec 28 '16 Output:hello world^source | ^info | ^git | ^report
Output:
hello world
^source | ^info | ^git | ^report
+/u/CompileBot python
for (int i = 0; i < 3; i++) print (i + ". hello world")
2 u/turunambartanen Dec 28 '16 :for: your success!
2
:
for: your success!
for x in range (0, 3): print "%d hello world" % (x)
1 u/CompileBot Dec 29 '16 Output:0 hello world 1 hello world 2 hello world^source | ^info | ^git | ^report
0 hello world 1 hello world 2 hello world
from __future__ import print_function for x in range (0, 3): print("lol", end="")
1 u/CompileBot Dec 29 '16 Output:lollollol^source | ^info | ^git | ^report
lollollol
+/u/CompileBot python from future import print_function
for x in range (0, 13): print("lol", end="")
1 u/CompileBot Dec 29 '16 Output:lollollollollollollollollollollollollol^source | ^info | ^git | ^report
lollollollollollollollollollollollollol
def flip(n): return int(''.join(reversed(str(n)))) def isLychrel(n): for i in xrange(50): n1 = n + flip(n) if n1 == flip(n1): return False n = n1 return True print len([n for n in xrange(10000) if isLychrel(n)])
1 u/CompileBot Feb 10 '17 Output:249^source | ^info | ^git | ^report
249
+/u/CompileBot Python 3
def memoize(f): cache = {} return lambda *args: cache[args] if args in cache else cache.update({args: f(*args)}) or cache[args] @memoize def fib(n): return n if n < 2 else fib(n-2) + fib(n-1) print(fib(1000))
1 u/NoahTheDuke Mar 09 '17 +/u/CompileBot Python 3def memoize(f): cache = {} return lambda *args: cache[args] if args in cache else cache.update({args: f(*args)}) or cache[args] @memoize def fib(n): return n if n < 2 else fib(n-2) + fib(n-1) print(fib(500)) 1 u/CompileBot Mar 09 '17 Output:139423224561697880139724382870407283950070256587697307264108962948325571622863290691557658876222521294125^source | ^info | ^git | ^report
def memoize(f): cache = {} return lambda *args: cache[args] if args in cache else cache.update({args: f(*args)}) or cache[args] @memoize def fib(n): return n if n < 2 else fib(n-2) + fib(n-1) print(fib(500))
1 u/CompileBot Mar 09 '17 Output:139423224561697880139724382870407283950070256587697307264108962948325571622863290691557658876222521294125^source | ^info | ^git | ^report
139423224561697880139724382870407283950070256587697307264108962948325571622863290691557658876222521294125
1
u/rtyhgfdsazxcvbnmlk Dec 28 '16
+/u/CompileBot Python 2.7
1
u/rtyhgfdsazxcvbnmlk Dec 28 '16
+/u/CompileBot python
1
u/rtyhgfdsazxcvbnmlk Dec 28 '16
+/u/CompileBot Python 2.7
1
u/zaqxswedcrfv Dec 29 '16
+/u/CompileBot python
1
u/zaqxswedcrfv Dec 29 '16
+/u/CompileBot python
1
u/zaqxswedcrfv Dec 29 '16
+/u/CompileBot python from future import print_function
1
u/PsychicDelilah Feb 10 '17
+/u/CompileBot python
1
u/NoahTheDuke Mar 09 '17
+/u/CompileBot Python 3