Python Forum
I'm not sure why this code isn't printing... Can someone tell me?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm not sure why this code isn't printing... Can someone tell me?
#2
What do you get if you add a print statement before the if ad == "Attack":

if decision == "Yes":
    print "You decide to continue on with your journey!"
    print "You descend into the first room..."
    print "But there is a monster blocking your path!"
    print "Do you 'Attack' or 'Defend'?"
    ad = input("Attack or Defend? ")

print("ad = " + ad)

if ad == "Attack":
    print "You decide to attack the monster!"
    print "You do " + int(hero_att) + " with your " + hero_weapon + "!"
(Also, unless you have a really good reason for using Python 2, you should really work with Python 3.)
Reply


Messages In This Thread
RE: I'm not sure why this code isn't printing... Can someone tell me? - by mpd - Mar-01-2018, 04:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Code printing twice hypersdevelopment 3 6,369 Sep-09-2018, 12:06 AM
Last Post: hypersdevelopment

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020