Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Very beginner needs help
#1
Hello! I've just, and I mean *just*, started playing with python using pycharm and I've run into a problem while trying to follow a video tutorial on coding a very basic text based game. I thought I did things correctly but apparently I did something wrong somewhere.

def fight():
    print("%s     Vs.     %s" % playerc.name, enemy.name)
    print("%s's Health: %s/%s   %s's Health: %s/%s" % playerc.name, playerc.health, playerc.maxhealth, enemy.name,
          enemy.health, enemy.maxhealth)
It keeps giving me this error and I don't know what is happening.
Error:
line 116, in fight print('%s Vs. %s' % playerc.name, enemy.name) TypeError: not enough arguments for format string

Sorry if this is painfully obvious but I don't know what it could mean, or even if I should be providing more information to solve it.
Reply


Messages In This Thread
Very beginner needs help - by bostltch - Feb-03-2018, 10:54 PM
RE: Very beginner needs help - by mcmxl22 - Feb-03-2018, 11:35 PM
RE: Very beginner needs help - by bostltch - Feb-03-2018, 11:50 PM
RE: Very beginner needs help - by Larz60+ - Feb-04-2018, 12:17 AM

Forum Jump:

User Panel Messages

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