Most importantly you have to save your random choice so you can verify it later. So you should asign two variables before:
player = random.choice(Players)
club = random.choice(Clubs)
print('Did ' + player + ' play for ' + club + ' ? Y/N')
Then you can verify that yourself via if statements. But a faster (more complex) way would be:
did_play = club in [Evra, Ferdinand, Ramos, Pique][Players.index(player)]
It would be better to store the variables Evra
, Ferdinand
, Ramos
and Pique
differently, but for now that should to the trick.
A better way to store those variables would be in a dictionary like such:
player_clubs = {
"Patrice Evra": ['Manchester United', 'Nice', 'Monaco', 'Marseille', 'West Ham United'],
"Rio Ferdinand": ['Leeds United', 'Manchester United'],
"Sergio Ramos": ['Sevilla', 'Real Madrid'],
"Gerard Pique": ['Barcelona', 'Manchester United']
}
That way you can easier check if they played in a certain club like:
did_play = club in player_clubs[player]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…