Skip to content

natnew/Python-Projects-Generate-A-Story

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Python Projects: Generate A Story 🐍

This repo contains python code that generates a story.
Run the code.

Python

import random
when = ['A few years ago', 'Yesterday', 'Last night', 'A long time ago','On 1st Jan', 'Once upon a time', 'Before man walked the earth']
who = ['a rabbit', 'an elephant', 'a mouse', 'a turtle','a cat', 'a chicken', 'a butterfly', 'an ant']
name = ['Natasha', 'Ben', 'Casandra', 'Emily', 'Sam', 'George', 'Carmel']
residence = ['Spain','Russia', 'Germany', 'Venice', 'England', 'Ireland', 'Scotland', 'Wales', 'France', 'Italy', 'Austria']
went = ['cinema', 'laundry', 'party', 'mountains', 'lake', 'funfare', 'circus', 'zoo']
happened = ['made a lot of friends','Eats a burger', 'found a secret key', 'solved a mistery', 'wrote a book']

print(random.choice(when) + ', ' + random.choice(who) + ' that lived in ' + random.choice(residence) + ', went to the ' + random.choice(went) + ' and ' + random.choice(happened) + '.')

Output

Once upon a time, a cat that lived in Austria, went to the laundry and solved a mistery.

About

Python Projects Generate A Story

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages