mercredi 20 janvier 2021

How do I make python randomly select something from a list and if typed in the input prompt, it will show the exact answer as intended

Basically, I want to make a game something like among us, but different, just for fun Anyways whenever I try to make it work, it will say my desired message no matter what. Here's the code:

import turtle   
t=turtle.Turtle()  
import random       

imposteris = ['red', 'blue', 'green', 'cyan', 'lime', 'black', 'white', 'purple', 'orange', 'brown']  
random.choice("imposteris")  
n = 1

print("Welcome to among them, you are a detective, figure out who the imposter is")   
meeting = int(input("Press 1 if you want to call a meeting"))   
if meeting:   
  input("A meeting has been called! Who do you think the imposter is?, Do either red, blue, green, cyan, lime, black, white, purple, orange, brown")   
  for i in range(n):   
    if random.choice(imposteris):   
      print("Congratulations, You caught the imposter.")      
    else:   
      print("He was a crewmate :/")

 



Aucun commentaire:

Enregistrer un commentaire