3xiondev — 11/25/2025, 3:41:33 PM
rects = [[int(input("Length 1: ")), int(input("Width 1: "))], [int(input("Length 2: ")), int(input("Width 2: "))]]
print("Rect 1 is bigger" if ((rects[0][0] * rects[0][1]) > (rects[1][0] * rects[1][1])) else "Rect 2 is bigger" if ((rects[0][0] * rects[0][1]) < (rects[1][0] * rects[1][1])) else "They're the same")

#MINIFICATION

i submitted this program to my teacher

♥ 2 ↩ 0 💬 7 comments

comments

pufferfish101007:

I loved doing this sort of thing when i did cs at school, it's very good fun. An alternative (i haven't checked this and wrote it on my phone so sorry if there's a syntax error):

 rects = [input(f"{['Length', 'Width'][n%2]} {n+1}: ") for n in range(4)]
print(["Rect 2 is bigger", "They're the same", "Rect 1 is bigger"][int(1 + (diff := rects[0] * rects[1] - rects[2] * rects[3]) // abs(diff))]
11/25/2025, 6:44:03 PM
3xiondev:

damn, clever way of doing it. the unminified version of my code is ugly as hell and very inefficient and i definitely would have written it better but the cs teacher made us write it that way

i wrote the program in somewhere around 30 seconds and decided it might be fun to minify it

11/25/2025, 6:49:03 PM
pufferfish101007:

very nice, definitely keep finding ways to make these menial programming tasks more interesting!

11/25/2025, 8:20:47 PM
cheesewhisk3rs:

What language is this

11/25/2025, 3:54:48 PM
3xiondev:

python because of course it is

11/25/2025, 3:59:45 PM
cheesewhisk3rs:

That doesn’t look like python

11/25/2025, 4:34:57 PM
3xiondev:

that’s probably because it’s hand-minified python

like minjs but shittier and harder to read

11/25/2025, 6:36:26 PM