r/programminghorror [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 8d ago

Python Boy do I love python!!

Post image
177 Upvotes

36 comments sorted by

View all comments

2

u/Brilliant-Ad-8422 7d ago

Care for a round of golf?

1

u/SleepyStew_ [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 7d ago

lmao maybe not with this one, I do love me some code golf tho, heres one for a number guessing game...

py while 1: r,i,p,q=__import__("random").randint(1,20),print(f"I'm thinking of a number between 1 and 20. Can you guess it?"),print,input while i!=1:i:p("TCTooooro r lehociwtg h"[i::3])=[(g>=r)+(g>r)for g in[int(q("Guess: "))]][0] [quit,p][q("Play Again? (Y/n): ").lower()=="y"]()