Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23276

how to properly loop and print json record in a single line

$
0
0

The code below loops through the records and displays the result vertical one after another.

Here is what i want

I need to print this text in a single line Eg. Stackoverflow.com is a Programmers Question and Answering Site

import osimport jsonmy_json = '["Stack", "over" , "flow", ".com", "is a ", "Programmers Question and Answering Site"]'data = json.loads(my_json)# for result in data.values():for result in data:    print(result)# Display the result in a single line

Viewing all articles
Browse latest Browse all 23276

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>