Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的代码
user_action = input("enter rock, paper, or scissors: ") possible_action = ["rock", "paper", "scissors"] computer_action = random.choice(possible_action)
它告诉我这是一个无效的变量。
我做错了什么还是Pydroid的错?
唯一可能的问题是您忘记了
随机导入
这段代码工作得很好:
import random user_action = input("enter rock, paper, or scissors: ") possible_action = ["rock", "paper", "scissors"] computer_action = random.choice(possible_action) print(computer_action)