Advertisement
Protocol_

coin flip

Oct 16th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. from random import choice
  2. class coin:
  3.     def flip(self, x):
  4.         myList = ['head', 'tails']
  5.         rand = choice(myList)
  6.         if x == rand:
  7.             print('You win! :D')
  8.         else:
  9.             print('Better luck next time D:')
  10. while True:
  11.     usrin = input("Head or Tails : ").lower()
  12.     cf = coin()
  13.     cf.flip(usrin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement