dashernasher
dashernasher

Reputation: 47

Error inconsisted use of tabs what to do

I am making a text based game in python 3.3.3. This is my code:

    print ("You must answer all questions in block capitals")
    print ("Welcome to maze runner")
    print ("To learn about the controls press C")
    print ("To learn the about the different types T")
    print ("To play press START")
    run = input ()
    #Controls
    if run == "C":
       print ("To attack press H")
       print ("To walk forward press W")
       print ("To turn left press A")
       print ("To turn right press D")
       print ("To turn around press S")
       print ("To block press B")
       print ("To open stats press Q")
       print ("To open this screen press C")
       print ("To close this screen press C")
       #Types
    if run == "T":
       print ("Soldier. Press S for more info")
       print ("Archer. Press A for more info")
       print ("Mage. Press M for more info")
       print ("Shape shifter. Press SS for more info")
       type_info = input ()
       #Solider info
       if type_info == "S":
          print ("Soldier: Good at close combat")
          print ("         Weak at long range combat")
          print ("         Average speed")
          print ("         Average blocker")
          print ("Press S to go back")
      #Archer info
      if type_info == "A":
         print ("Archer: Weak at close combat")
   print ("        Good at long range combat")
   print ("        Good speed")
   print ("        Average blocker")
   print ("press A to go back")

the error I get is "inconsistent use of tabs and spaces in indentation" it then highlights the end of the line:

          print ("        Good at long range combat")

what is wrong??

Upvotes: 0

Views: 65

Answers (1)

Kevin
Kevin

Reputation: 76254

The problem becomes more apparent when you use an editor that can show tab and space characters:

enter image description here

The above is a screenshot from Notepad++. Lines 36 thorugh 39 are indented using a mix of tabs (arrows) and spaces (dots). Replace each of those tabs with some number of spaces (ten spaces, if you want the print statements to be within the if type_info == "A" conditional block)

Upvotes: 1

Related Questions