title: Convert JSON string to dictionary in ROBOT using json.loads() - why are triple quotes needed?
body: <p>I've read that json.loads() can be used by Robot Framework to convert a JSON string to a dictionary in this post: <a href="https://stackoverflow.com/questions/35262216/json-handling-in-robot">Json handling in ROBOT</a></p>
  
  <p>So if you define a dictionary-like string like this:</p>
  
  <pre><code>${json_string}    Set Variable    {"key1": "value1", "key2": "value2", "key3": "value3"}
  </code></pre>
  
  <p>You can then use the following to convert it to a dictionary:</p>
  
  <pre><code>${dict}    Evaluate    json.loads('''${json_string}''')    json
  </code></pre>
  
  <p>My question is simple - why are the triple quotes needed here to surround the argument?</p>
  
  <p><s>If single quotes are used an exception is thrown stating a string must be used:</p>
  
  <pre><code>${dict}    Evaluate    json.loads('${json_string}')    json
  </code></pre>
  
  <p></s>(Edit) The above is a bad example, it actually works.  If double quotes are used, though, it fails for SyntaxError: invalid syntax.</p>
  
  <p>If no quotes at all are used an error occurs that indicates that the variable is a dictionary - but in Robot it isn't a dictionary (TypeError: the JSON object must be str, bytes or bytearray, not dict):</p>
  
  <pre><code>${dict}    Evaluate    json.loads(${json_string})    json
  </code></pre>
  
  <p>If Robot's Convert To String is used on the ${json_string} variable and then that new variable is passed to the json.loads() method the same TypeError occurs stating a string must be used, not a dictionary - but it has been converted to a string:  </p>
  
  <pre><code>${json_string2}    Convert To String    ${json_string}
  ${dict}    Evaluate    json.loads(${json_string2})    json
  </code></pre>
  
  <p>What are the triple quotes accomplishing that are not being accomplished by the other two?  This seems to be an aspect of Robot framework...</p>