Story Generator#91
Open
AdyaTech wants to merge 1 commit into
Open
Conversation
|
👋 @AdyaTech |
iamwatchdogs
requested changes
May 20, 2026
Contributor
iamwatchdogs
left a comment
There was a problem hiding this comment.
Hi @AdyaTech, please make the following changes to proceed with your PR:
- Update the Python script with relevant changes.
- Rename your project directory based on the specified guidelines.
Please don't create a new commit to implement the requested changes. Instead, amend the existing commit and force push the changes to the PR branch.
Comment on lines
+1
to
+8
| import random | ||
| when = ['A few years ago', 'Yesterday', 'Last night', 'A long time ago','On 20th Jan'] | ||
| who = ['a rabbit', 'an elephant', 'a mouse', 'a turtle','a cat'] | ||
| name = ['Ali', 'Miriam','daniel', 'Hoouk', 'Starwalker'] | ||
| residence = ['Barcelona','India', 'Germany', 'Venice', 'England'] | ||
| went = ['cinema', 'university','seminar', 'school', 'laundry'] | ||
| 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)) No newline at end of file |
Contributor
There was a problem hiding this comment.
You must write code that is readable an understanable
Suggested change
| import random | |
| when = ['A few years ago', 'Yesterday', 'Last night', 'A long time ago','On 20th Jan'] | |
| who = ['a rabbit', 'an elephant', 'a mouse', 'a turtle','a cat'] | |
| name = ['Ali', 'Miriam','daniel', 'Hoouk', 'Starwalker'] | |
| residence = ['Barcelona','India', 'Germany', 'Venice', 'England'] | |
| went = ['cinema', 'university','seminar', 'school', 'laundry'] | |
| 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)) | |
| import random | |
| when = [ | |
| "A few years ago", | |
| "Yesterday", | |
| "Last night", | |
| "A long time ago", | |
| "On 20th January" | |
| ] | |
| who = [ | |
| "a rabbit", | |
| "an elephant", | |
| "a mouse", | |
| "a turtle", | |
| "a cat" | |
| ] | |
| names = [ | |
| "Ali", | |
| "Miriam", | |
| "Daniel", | |
| "Houuk", | |
| "Starwalker" | |
| ] | |
| places = [ | |
| "Barcelona", | |
| "India", | |
| "Germany", | |
| "Venice", | |
| "England" | |
| ] | |
| went_to = [ | |
| "cinema", | |
| "university", | |
| "seminar", | |
| "school", | |
| "laundry" | |
| ] | |
| happened = [ | |
| "made a lot of friends", | |
| "ate a burger", | |
| "found a secret key", | |
| "solved a mystery", | |
| "wrote a book" | |
| ] | |
| story = ( | |
| f"{random.choice(when)}, " | |
| f"{random.choice(names)} the {random.choice(who)} " | |
| f"from {random.choice(places)} went to the " | |
| f"{random.choice(went_to)} and " | |
| f"{random.choice(happened)}." | |
| ) | |
| print(story) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 Story Generator (using Python)
📌 Introduction
The Story Generator is a fun Python project that creates random short stories by combining different words and phrases from predefined lists.
Each time the program runs, it generates a unique and sometimes hilarious story using random selections for characters, locations, events, and actions.
🚀 Features
randommodule💻 Example