Advertisement
black_duck11

or

Mar 26th, 2025
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. import random
  2. import time
  3. print('o-orzeł')
  4. print('r-reszka')
  5. print('0-zakończenie gry')
  6. gracz=0
  7. komputer=0
  8. while True:
  9.     wybor=input('Twój wybór to: ')
  10.     if wybor=="0":break
  11.     elif wybor=='r':wybor='reszka'
  12.     elif wybor=='o':wybor='orzeł'
  13.     else:
  14.         print("Dokonaj prawidłowego wyboru")
  15.         print('o-orzeł')
  16.         print('r-reszka')
  17.         print('0-zakończenie gry')
  18.         continue
  19.     rzut=random.choice(["orzeł","reszka"])
  20.     time.sleep(3)
  21.     print(f'Wynik rzutu: {rzut}')
  22.     if wybor==rzut:
  23.         gracz+=1
  24.     else:
  25.         komputer+=1
  26.     print("Wyniki łącznie")
  27.  
  28.     print(f'Komputer: {komputer}')
  29.     print(f'Użytkownik: {gracz}')
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement