0

I am working with a JSON file, below.

[
  {
  "text": "Now that's JSON!",
  "secret text": "Now that's some _serious_ JSON!"
},
{
  "text": "edited",
  "secret text": {"type":"Now that's some _serious_ JSON!", "coordinates":[15.3,11]}
}
]

I want to print to the console the coordinate as follows, without the brackets or commas.

15.3 11

import json

with open('message.json') as message_json:
  message = json.load(message_json)


print(message[1]['secret text']["coordinates"][:])

and i get the following:

[15.3, 11]

how can i print to console so that it is 15.3 11 no brackets or commas are included. and i want this to be a dynamic solution so it applies to all examples not just this. thank you so much

Wondercricket
  • 7,651
  • 2
  • 39
  • 58

0 Answers0