Anyone know how to code in Python? I have an assignment due tomorrow and my teacher has been useless

Devourer·12/17/2015, 12:14:04 AM·1 votes·1,202 views

I have a major python assignment due tomorrow Ive been working extremely hard on but I hit a brick wall, I can paste my code into a reply if anyone is willing to help. Ive asked all my friends and links but no one could figure it out or had much python experience. Thanks ahead of time.

9 Comments

PDE5 Inhibitors12/17/2015, 12:15:03 AM1 votes

Do you anything about pharmacoeconomics? I have a test in it tomorrow. My teacher hasn't been useless, but my attention has been and I'm still procrastinating studying by playing on the League boards lol.

Here ya go. https://www.python.org/about/gettingstarted/

Devourer12/17/2015, 12:16:11 AM1 votes

My coding:

import sys inventory = []

print "Hello, what happens to be your name?"

name = raw_input("What is your name?")

print """Welcome %s, you have been captured!!! You must attempt to escape the castle, or if you are feeling particularly lazy, wait for help to arrive (which may never happen)!!! What will you choose?""" % (name)

print "Wait, or Escape?"

path = raw_input("Will you wait or escape?")

if path == "wait": print "Help never comes and you eventually die of boredom... Game Over." raise SystemExit

if path == "escape": print "You find 3 tools but can only carry one, which one will you take?" toolc = raw_input("Options: 1 = Dagger, 2 = Candle, and 3 = Hammer")

if toolc == "1": inventory.append("Dagger") print "You have chosen the dagger!"

elif toolc == "2": inventory.append("Candle") print "You have chosen the candle!"

elif toolc == "3": inventory.append("Hammer") print "You have chosen the hammer!"

print """Level 1: You are in a dungeon at the bottom of a castle, the room is relatively dark, and a locked door is visible, what do you do?"""

if inventory.index("Dagger"): level1 = raw_input("Use your dagger, type dagger to do so!")

Side note, everything is spaced properly, it just doesn't show up in the comment. Everything works fine up until the end at the if inventory statement, the console just ignores it completely even if you choose the dagger in the previous options. I have tested to make sure the chosen item is placed in the inventory so that's not the problem, I don't even get an error message to help me too.