Nov-28-2020, 07:56 PM
I am using "praw" to pull reddit topic posts in a specific subreddit and here's my code:
post 1
post 2
post 3
post 4
etc.
I would like to put it in a format all on 1 line separated by commas, or perhaps just into 1 single list separated by specific words like this:
[post, 1, post, 2, post, 3, post, 4]
for submission in reddit.subreddit('finance').hot(limit=50): titles = submission.title.replace("\n", " ") print(titles)However, the return I am getting puts each post into an iterated format like below:
post 1
post 2
post 3
post 4
etc.
I would like to put it in a format all on 1 line separated by commas, or perhaps just into 1 single list separated by specific words like this:
[post, 1, post, 2, post, 3, post, 4]