2

Ok , so for some days i continously get this error and i make simple python problems and this still comes out of nowhere i really dont understand what i m wrong with

def counterpartCharCode(char):
    a = char.upper()
    b = char.lower()
    if char == a:
        return ord(b)
    else:
        return ord(a)

print(counterpartCharCode("A"))

File "e:/salut.py", line 3 b = char.lower() ^ IndentationError: unindent does not match any outer indentation level

gabi2000
  • 35
  • 3
  • copied your code and work fine... could your indentation issue only in your IDE? – adir abargil Nov 18 '20 at 15:36
  • can you give us a screenshot? – Tugay Nov 18 '20 at 15:37
  • Get a better IDE/text editor. One that shows whitespace characters. –  Nov 18 '20 at 15:39
  • Does this answer your question? [IndentationError: unindent does not match any outer indentation level](https://stackoverflow.com/questions/492387/indentationerror-unindent-does-not-match-any-outer-indentation-level) – Tomerikoo Nov 18 '20 at 16:07

1 Answers1

4

You have mixed tabs and spaces, a mortal sin. Editing your code I see

SSSTa = char.upper()
SSSSb = char.lower()

where S is space and T is tab.

mCoding
  • 4,059
  • 1
  • 5
  • 11