π§ 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
-
whileloops - 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)