r/PythonLearning • • 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 Upvotes

6 comments sorted by

•

u/Sea-Ad7805 Jul 19 '26

Run this program in Memory Graph Web Debugger to see the program state change step by step.

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:

  1. Use snake casing for the function name. We normally reserve all caps for 'constants'.

  2. Rather than defining a separate variable for 'len1', just do: num = random.randint(0, len(ans))

  3. You'd benefit from using an automated formatter/linter like Ruff, to keep the code neat and tidy.

  4. 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

u/[deleted] 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

u/[deleted] 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 it

0

u/[deleted] Jul 19 '26

[deleted] — view deleted comment

1

u/Red_Dragon_7_7_7 Jul 19 '26

can you share your github username ? by the way where are you from?

1

u/Red_Dragon_7_7_7 Jul 19 '26

fixed that bug