๐ง Day 27 of My 90 Days Python Series โ Random Fun Fact Generator ๐
Ever get stuck in tutorial loops and forget to have fun with code?
Well, todayโs project is light, quick, and guaranteed to make you smile.
โจ What I Built
I created a Fun Fact Generator โ a simple Python program that gives you a random fun fact every time you run it. Just press Enterโฆ and boom, a fun fact appears on your screen.
This is perfect for:
- Practicing loops and list handling in Python ๐
- Beginners who want to build something hands-on
- Adding a creative break in your coding journey
๐งฐ Tools & Concepts Used
-
random.choice()
- Lists
-
while
loops - Input handling
๐งช How It Works
- A list stores all the fun facts.
- The program picks a random one.
- It displays it to you.
- Repeats until you type
exit
.
Hereโs a small example:
python
import random
fun_facts = [
"Bananas are berries, but strawberries aren't!",
"Octopuses have three hearts.",
"Butterflies taste with their feet.",
"Honey never spoils.",
"Sharks existed before trees."
]
print("โจ Welcome to the Fun Fact Generator โจ")
while True:
user_input = input("Press Enter for a fun fact or type 'exit': ").strip().lower()
if user_input == "exit":
print("Thanks for exploring fun facts with me! ๐ธ")
break
print(random.choice(fun_facts))
๐งญ Sample Output
โจ Welcome to the Fun Fact Generator โจ
Press Enter for a fun fact or type 'exit':
๐ Honey never spoils.
Press Enter for a fun fact or type 'exit':
๐ฆ Sharks existed before trees.
๐ GitHub Repo
Check out the full code here ๐
๐ Day-27 Fun Fact Generator
๐ง What I Learned
How simple ideas can be fun to build
Using randomness to make programs feel interactive
The joy of creating something others can enjoy too โจ
here is the link;
[https://github.com/shadowMomina/Day-27-Fun-Fact-Generator-.git](https://github.com/shadowMomina/Day-27-Fun-Fact-Generator-.git)
๐ฌ Your Turn!
If you could add ONE fun fact to this project, what would it be?
Drop it in the comments, and I might feature your fact in the next update ๐
Top comments (0)