I'm new to Python scripting and I don't understand what is wrong with this code. I want to concatenate the string values from GRID1MIL and GRID100K. I've created a text column MGRS to begin with.
I also tried writing the following but it did not work:
Using VB Script I was able to do it easily but I want to learn how it's done with Python.
Answer
I think you're almost there, but you need to get your indentation consistent. Indentation is very important in Python and defines the scoping/grouping of statements. Suggested indentation is to add four spaces for every indentation level.
try keeping the same indentation for lines: c=a+b and return c
like this:
def addIt(a,b)
c = a + ' ' + b
return c
No comments:
Post a Comment