0

I’m a very new programmer to python currently learning global variables, I just am trying out writing my own code, I did but I received this error message: “Taberror: inconsistent use of tabs and spaces in indentation in line 14 at print(“Python is “+ x)

Here is the code:

x = "awesome"

def myfunc():
global x
x = "fantastic"
print("Python is " + x)

myfunc()

def myfunc2():
x = "awesome"
print("\n") # new line in output
print("Python is " + x)

myfunc2()

It seems to be that the + x at the second function is the part that is seen as an error.

All assistance will be great!

  • Use a text editor, check that you do not have tabs for indentation, and replace them with spaces. Ideally you could parameter your text editor to automatically add spaces when you indent with tabs. – mozway Mar 25 '22 at 07:34

0 Answers0