r/learnpython • u/MadHedge • 16m ago
Fixing my skipped list
So I just posted a post and had to delete because I realized I fucked up and didn’t upload any code with it. I have a project in Python that I have to make. Mine is going to be a text adventure game and it keeps skipping the enmy list. It also just reloops regardless of if the user dies or not.
Here is the section of the code:
for i in range(len(loc)):
current_loc=loc[i]
current_dsrp=dsrp[i]
current_nos=nos[i]
current_enmy=enmy[i]
print("\nYou find yourself in,:" + current_loc + ".")
print(current_dsrp)
print(current_nos)
choice = input("\nDo you want to investigate? (Yes or No): ").lower()
while choice != "yes" and choice != "no":
print("You cower away and die of fear!")
else:
choice == "yes"
printItem(current_enmy)
conChoice = input("\nDo you wish to continue? (Yes or No): ").lower()
while conChoice != "yes" and conChoice != "no":
print("You curl in a ball and cry.")
if conChoice == "no":
conChoice == "no"
print("You have died from dehydration and fear!")
else:
print("You have escaped the killer!")
main()