Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c0b68a7

Browse files
Merge pull request avinashkranjan#2454 from Shivansh-Jain-github/cont1
Adding code and README.md file for Random Quote generation from list
2 parents 7859c6a + 515eb9c commit c0b68a7

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

‎Random Quote Generator/README.md‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Sure, here's a sample `README.md` for the provided Python script:
2+
3+
```markdown
4+
# Random Inspirational Quote Generator
5+
6+
This is a simple Python script that generates random inspirational quotes. Each time you run the script, it will randomly select and print one of the inspirational quotes from the list.
7+
8+
## Usage
9+
10+
1. Make sure you have Python installed on your system.
11+
2. Download or clone this repository to your local machine.
12+
13+
```bash
14+
git clone https://github.com/your-username/random-quote-generator.git
15+
cd random-quote-generator
16+
```
17+
18+
3. Run the script using Python:
19+
20+
```bash
21+
python random_quote_generator.py
22+
```
23+
24+
4. The script will display a randomly chosen inspirational quote on the console.
25+
26+
## Inspirational Quotes
27+
28+
The script uses the following list of inspirational quotes:
29+
30+
- "Believe you can and you're halfway there. - Theodore Roosevelt"
31+
- "The only limit to our realization of tomorrow will be our doubts of today. - Franklin D. Roosevelt"
32+
- "Success is not final, failure is not fatal: It is the courage to continue that counts. - Winston Churchill"
33+
- "Your time is limited, don't waste it living someone else's life. - Steve Jobs"
34+
- "The only way to achieve the impossible is to believe it is possible. - Charles Kingsleigh"
35+
- "The only thing standing between you and your goal is the story you keep telling yourself. - Jordan Belfort"
36+
- "You are never too old to set another goal or to dream a new dream. - C.S. Lewis"
37+
- "The future belongs to those who believe in the beauty of their dreams. - Eleanor Roosevelt"
38+
- "The best way to predict the future is to create it. - Peter Drucker"
39+
- "The only thing standing between you and your goal is the story you keep telling yourself. - Jordan Belfort"
40+
41+
Feel free to modify the list of quotes in the `random_quote_generator.py` file to add your own favorite quotes.
42+
43+
## License
44+
45+
This project is licensed under the [MIT License](LICENSE).
46+
47+
```
48+
49+
Please replace `your-username` in the repository URL with your actual GitHub username if you decide to create a repository for this script. Also, ensure that you have the appropriate license file (e.g., `LICENSE`) in the same directory as the `README.md` file.

‎Random Quote Generator/code.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import random
2+
3+
# List of inspirational quotes
4+
inspirational_quotes = [
5+
"Believe you can and you're halfway there. - Theodore Roosevelt",
6+
"The only limit to our realization of tomorrow will be our doubts of today. - Franklin D. Roosevelt",
7+
"Success is not final, failure is not fatal: It is the courage to continue that counts. - Winston Churchill",
8+
"Your time is limited, don't waste it living someone else's life. - Steve Jobs",
9+
"The only way to achieve the impossible is to believe it is possible. - Charles Kingsleigh",
10+
"The only thing standing between you and your goal is the story you keep telling yourself. - Jordan Belfort",
11+
"You are never too old to set another goal or to dream a new dream. - C.S. Lewis",
12+
"The future belongs to those who believe in the beauty of their dreams. - Eleanor Roosevelt",
13+
"The best way to predict the future is to create it. - Peter Drucker",
14+
"The only thing standing between you and your goal is the story you keep telling yourself. - Jordan Belfort"
15+
]
16+
17+
def generate_random_quote():
18+
return random.choice(inspirational_quotes)
19+
20+
if __name__ == "__main__":
21+
print("Welcome to the Random Inspirational Quote Generator!")
22+
print("Here's your quote for today:")
23+
print(generate_random_quote())

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /