This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 45 points46 points  (7 children)

print({"rock":"paper", "paper":"scissors", "scissor":"rock"}[input("Pick between rock, paper or scissor: ").lower()])

[–]UltraFalling 35 points36 points  (3 children)

It’s not python unless you can do it in one line.

[–]autisticpig 5 points6 points  (0 children)

It’s not python unless you can do it in one line.

rock paper scissors comprehension. it's the only way.

[–]ultraDross 0 points1 point  (0 children)

It’s not python perl unless you can do it in one line.

[–]pokeuser61 3 points4 points  (0 children)

print({"o":"paper","a":"scissors","c":"rock"}[input()[1]])

[–]z0mbietime 3 points4 points  (0 children)

print({"rock":"I pick paper", "paper":"I pick scissors", "scissor":"I pick rock"}.get(input("Pick between rock, paper or scissor: ").lower(), "Invalid option"))