Skip to content
← Back to Community
The most complicated "hello world" program in a single line
Profile icon
MarcusWeinberger

How it was made

First, I went through all the characters in "hello world" and used ord to find their numerical values. Using the argcount of a bunch of lambdas, I got a list of numbers 1 through 7. Using that list, I simply did some maths to get the numbers and printed them as ascii using chr.

I wrapped this in a couple lambdas using globals().update to set variables inline (repl.it recently updated to python 3.8 so I could have used the := operator however it appears not to work in list comprehension) and bam.

(ignore the syntax errors, it still runs)

Voters
Profile icon
SilvermoonCat
Profile icon
ch1ck3n
Profile icon
halo4936
Profile icon
zplusfour
Profile icon
Wilke000
Profile icon
SilverWolf8730
Profile icon
metalcupcake5
Profile icon
BismuthIIIOxide
Profile icon
thebest1234
Profile icon
MrMinimax
Comments
hotnewtop
Profile icon
[deleted]

1810 bytes just to print "hello":

x=list(str(sum([*map(lambda x:sum([*map(int,(bin(ord(x))[2:]))]),'hello world!')])*(1<<1|1)));y=x[9//2//(9//2)];x[654**0<<1]=x[3>>1];x[(10^1)&1]=eval(chr(ord('Y')+(2<<4)),locals());x=__import__('htam'[::~0]).sqrt(int('abc'[:8*(2>>3)].join(x)));x=int(x//4*(2<<2>>1))+[~~(1&1&1&1&1&1&1)][0];x*=len(hex(3735928559)[[*[2<<1>>1]][0]:]);print(chr(x),file=getattr(__import__(chr(ord('S')+(2<<4))+'y'+chr(ord('t')-1)),'stdout'),end='');x=str(6+(2&3^2&3))+[*map(str,[*[int(str(6))+(6//2)]])][0];y=int((int(x)|[*[4*((34^34)|1<<3)]][0]));i=sum([*[*[*[y if ~((int(x)*c)>y) else 0 for c in range(5^5,int(str(10)*2,base=2<<1>>1),5%2)]]]]);i=int(str(i)[:~0]);z=getattr(__import__(chr(int('12'[:5&abs(~0)]*(1<<1|1)))+chr(i+(1<<2|1<<1|1)+int(hex(7)[2:],base=16))),'sys');getattr(z,'stdo'+chr(10**(1<<1)+(8*9-(7*9)+8))+chr(10**(1<<1)+(8*9-(7*9)+7))).write.__call__(chr(i));d={'ba'+[*[chr(ord('S')+(2<<4))]][0]+chr(int(bin(5)[2:])):2};x=ord(getattr(__builtins__,'ch'+chr(ord('R')+[*[2<<4]][0])).__call__(ord('0')+(2<<(int(str(ord('e')),**d))-(2<<1))));x=eval(compile('x','','eval'),globals())*(eval(type(5).__name__)(chr(eval(compile('x','','eval'),globals()))));x=int(x-(round.__call__(x//((7>>1)&2),-1)));a={'end':'end'[:2-(~~2)]};print(chr(x)*2,**{**a,**{'file':getattr(__import__(chr(ord('S')+((2<<5)//2))+chr(ord('n')+int(str(10)*2,base=2)+5%2)+chr(ord('S')+((2<<5)//2))),'_'*2+'stdo'+'u'+chr(ord('n')-ord('n')+ord('t'))+'_'*2)}});x=str(ord.__call__(chr(ord('0')+(2<<(int(str(ord('e')),base=2)%2+eval('~'*5+chr(48))))))*(1<<(5&(1<<0))));x=eval('__builtins__.__dict__')['chr'].__call__(int(x)+int(x[:[*[(5&1&1&1)+1]][0]])+int(x[:[*[1]][0]]));d={};print(x,file=getattr(eval('s',d) if not exec('import '+ord('y').__getattribute__('__repr__').__call__().replace('1','s').replace('2','y')+';s=sys',d) else None,'stdout'),end='');

Try it online!

Profile icon
MarcusWeinberger

@sugarfi jeeeeez now that's crazy

Profile icon
[deleted]
Profile icon
[deleted]

oh no

Profile icon
SixBeeps

This is too good. And it's in exactly 555 chars :D

Profile icon
[deleted]

And I noticed something else: 555 chars in the code, and 5 upvotes for first comment, 5 for the second one, and 5 for the third! This post is all about fives. @SixBeeps

Profile icon
SixBeeps

@CodeABC123 Too bad my name exists

Profile icon
[deleted]

And the first time I looked at your reply, it was posted 5 seconds ago! @SixBeeps

Profile icon
SilentShadowBla
Profile icon
Coder100

such verbose

while True and "verbose is verbose" and "this is as verbose as I can get": votes = int(str(votes + 0 + 1)) magic = int(str(magic + 1 + 0))
Profile icon
[deleted]

Oh boy, that's like reverse code golf. I love it

Profile icon
[deleted]

@enigma_dev code bowling

Profile icon
[deleted]

Generally, it's supposed to be "Hello world!", so it's missing a capital H, and an exclamation mark, "!"

Profile icon
Dart

“Code was built to be efficient and sleek. so let’s go in the exact opposite direction!”
(This really cool omg)

Profile icon
staticvoidliam7

im a cool kid

no i am

Profile icon
AlphaWarhead

No exclamation mark, 0/10

Profile icon
lungera

You should try Brainf.

Profile icon
[deleted]

@lungera whats that?

Profile icon
lungera
Profile icon
staticvoidliam7

im so gonna do this

Profile icon
MarcusWeinberger

@LiamDonohue let me know how it goes!

Profile icon
IsackSan

nice but overcomplicated.. Like my life!

Profile icon
AaravKyparlis

takes a while to load

Profile icon
MarcusWeinberger

@AaravKyparlis that's strange, for me, it's almost instant

Profile icon
AaravKyparlis

@MarcusWeinberger I probably have a laggy computer

Profile icon
AdCharity

at least this actually makes sense

Profile icon
[deleted]

@AdCharity You still remember don't you?

Profile icon
AdCharity

@Thecrowbar1234 that's the point

Profile icon
ChezCoder

i really dont know what to say...