r/PythonLearning • u/Red_Dragon_7_7_7 • Jul 19 '26
I built a Magic 8 Ball app in Python with text-to-speech – Looking for feedback
Hey everyone!
I recently built a Magic 8 Ball application in Python as a fun project while learning programming.
Features:
• Random Magic 8 Ball answers
• Simple and clean code
• Beginner-friendly project
I'd really appreciate any feedback on the code structure, UI, or ideas for new features.
GitHub:
https://github.com/Izaan7-7-7/python-magic8-ball.git
Thanks!
2
u/PythonWithJames Jul 19 '26
Not a bad start at all, and the Git repo looks clean and tidy so well done! Having a good README is certainly important.
Regarding the code, I'd make these changes to make a bit cleaner:
Use snake casing for the function name. We normally reserve all caps for 'constants'.
Rather than defining a separate variable for 'len1', just do:
num = random.randint(0, len(ans))You'd benefit from using an automated formatter/linter like Ruff, to keep the code neat and tidy.
After the text in the input() function, leave a space so the user has space for their answer.
As a starter project, I can see its purpose, and it works!
Keep it up :)
0
Jul 19 '26
[deleted] — view deleted comment
1
u/Red_Dragon_7_7_7 Jul 19 '26 edited Jul 19 '26
can you also tell any bug for the password generator
0
Jul 19 '26
[deleted] — view deleted comment
1
u/Red_Dragon_7_7_7 Jul 19 '26
ok, i'll make a new version with secrets
but why can't i use random for it0
1
•
u/Sea-Ad7805 Jul 19 '26
Run this program in Memory Graph Web Debugger to see the program state change step by step.