Refactored Multiple programs with error handling and input validation.#14
Open
JesusAlvarado48 wants to merge 3 commits into
Open
Refactored Multiple programs with error handling and input validation.#14JesusAlvarado48 wants to merge 3 commits into
JesusAlvarado48 wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request updates the magic8Ball.py script to be fully compatible with Python 3 and improves the program’s overall structure, readability, and behavior. The original version contained Python 2 print syntax, a broken nested loop structure, and hard‑coded random index logic. This update modernizes the script while preserving its beginner‑friendly nature.
Why This Change Was Needed
The original script did not run correctly under Python 3 and contained logic issues that prevented the “play again” feature from functioning as intended. Since this repository is aimed at beginners, providing clean, correct, and modern examples is important for learning.
Impact
Makes the script functional under current Python versions
Improves clarity for new learners exploring the repository
Aligns with the project’s goal of offering simple, high‑quality beginner projects
Testing
Manually tested multiple question/response cycles
Verified that both “Y/y” and “N/n” inputs behave correctly
Confirmed that random responses are selected properly