Quantcast
Channel: printing first 10 lines of my feed - Stack Overflow
Viewing all articles
Browse latest Browse all 2

printing first 10 lines of my feed

$
0
0
import json with open('output.json', encoding='utf-8') as json_file:     output = json.loads(json_file.read())feeds = []for feed in output ['posts']:   feeds.append (feed)print (feeds[1]['title'])

I am trying to print only the first 10 lines of my data. I tried 'enumerate' and other codes but none of them seem to work. Any ideas of how i can get only the first 10 titles of my output?


Viewing all articles
Browse latest Browse all 2

Trending Articles



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