How to generate random stories using python

So here we will learn random stories using python , So here we will use random package for generating story, It’s all about your creativity you can make funny , scary and romantic story and rest of part python will help you,

So lets see the code

import random

time = [“2 years ago”, ” today”, ” 1000 year ago”, ” yesterday”]

person_name = [“Rishbah”, “Piyush”,    “Apoorv”,”Kunal”,”Deva”,”Sumit”,”Nitin”,”Utkarsh”,”Shubhash”]

place = [“forest”,”zoo “,” Hotel”, “garden”]

food = [“chicken”,”panner”,”dosa”,”burger”]

drinks= [“beer”,”rum”, “whiskey”,”juice”,”milk”]

print(random.choice(time)+” “+random.choice(person_name)+” went to “+ random.choice(place)+” and he eaten “+random.choice(food)

+ ” and also drank “+ random.choice(drinks))

Here we have imported random and created some list where we have passed some string values and at the end we have print this using random here random will pick the random values from the list so here some funny stories

I hope you have learned how you can create random stories

Full code:

Keep learning!!

Leave a Reply

Your email address will not be published. Required fields are marked *