I have a function called \'checkdata(code)\' in javascript, which, as you can see, takes an argument called \'code\' to run and returns a 15-char string.
So, I found
Build the string
a = wd.execute_script("return checkdata('" + code + "');")
Rather than building a string (which means you'd have to escape your quotes properly), try this:
a = wd.execute_script("return checkdata(arguments[0])", code)