frederick99

ChoHan

Aug 27th, 2019 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # initial (109 bytes)
  2. from random import randrange as r
  3. def choHan(g):print("You",g==("even","odd")[(r(6)+r(6))%2]and"win"or"lose")
  4. # OR
  5. def choHan(g):print("You",("lose","win")[("even","odd")[(r(6)+r(6))%2]==g])
  6.  
  7. # edit (105 bytes)
  8. def choHan(g):print("You","lwoisne"["eovdedn"[(r(6)+r(6))%2::2]==g::2])
  9.  
  10. # final version (99 bytes)
  11. r=__import__('random').randrange
  12. def choHan(g):print("You","lwoisne"["eo"[(r(6)+r(6))%2]==g[0]::2])
Add Comment
Please, Sign In to add comment