J'essaie donc d'arranger le fonctionnement du gameplay de mon jeu de base de texte si le joueur peut/ne dispose pas de certains éléments dans son inventaire.Aide à l'inventaire Python
print ("You are back in your cell. You saw your bed, broken sink, grotty toilet, cut up jumpsuit")
if "comb" and "razor" in inventory:
print ("and the table with the empty bottle.")
else "comb" not in inventory and "razor" in inventory:
print ("and the table with the empty bottle and comb.")
else "razor" not in inventory and "comb" in inventory:
print ("and the table with the empty bottle and razor")
il me dit que j'ai une erreur de syntaxe dans cette ligne de code
else "comb" not in inventory and "razor" in inventory:
Je ne peux pas l'impression de voir quelle erreur j'ai fait, je suis un débutant alors peut-être il y a une façon alternative d'exécuter mes besoins.
Je pense que vous voulez dire 'elif', pas' else'. – khelwood