请使用Python代码生成一个简单的石头、剪刀、布游戏代码。用户必须和计算机对战。
user
```python
import random

def get_user_choice():
    user_choice = input("请出拳 (石头/剪刀/布): ")
    while user_choice not in ["石头", "剪刀", "布"]:
        user_choice = input("无效选择，请重新出拳 (石头/剪刀/布): ")
    return user_choice

def get_computer_choice():
    return random.choice(["石头", "剪刀", "布"])

def determine_winner(user_choice, computer_choice):
    if user_choice == computer_choice:
        return "平局"
    elif (user_choice == "石头" and computer_choice == "剪刀") or \
         (user_choice == "剪刀" and computer_choice == "布") or \
         (user_choice == "布" and computer_choice == "石头"):
        return "你赢了"
    else:
        return "你输了"

def play_game():
    user_choice = get_user_choice()
    computer_choice = get_computer_choice()
    print(f"电脑出的是: {computer_choice}")
    result = determine_winner(user_choice, computer_choice)
    print(result)

if __name__ == "__main__":
    play_game()
```
assistant