Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bad input
#1
def __init__(self, name, gender, hp,attack, mp,exp,level): 
      '''Use double underscores'''
      #This method initializes the attibutes of the Character class
      self.name = name
      self.gender = gender
      self.hp = hp
      self.attack = attack
      self.mp = mp
      self.exp = exp
      self.level = level
      #these are the Character's stats.
    def __str__(self):
      return(str(self.name)+":  level "+str(self.level)++str(self.hp)+" hp, ")
      '''To be used in battle'''
    def level_check(self):
      if self.level==0:
        level_exp=50
      if self.exp>=level_exp:
        self.level=self.level+1
        level.exp=level.exp*3
        stat_points=5
        while stat_points>0:
          #put something here later
  chara1=Chara(input("What is your name?"),input("Are you a boy or a girl? \n\t 1. Boy \n\t  2. Girl"),9,3,0,0,0)
This is my code. On the last line, there is a "SyntaxError: bad input on line 53 in main.py." I've looked through it and found that the problem has to do with my use of the inputs. I can't find what's wrong please help.
Reply
#2
Obviously we cannot know which is line 53.... post all your code and full traceback in error tags
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

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