π§βπ»: Refactor if-elif to match-case in main menu (Python 3.10+)
Title
Refactor if-elif to match-case in main menu (Python 3.10+) in Anime_manga_tracker from beginners project
Enhancement Aim
Currently, the main menu logic in main() uses multiple if-elif statements to handle user choices. Since Python 3.10+, match-case can be used as a cleaner and more modern alternative to simplify this logic.
Benefits
- Improves readability and maintainability
- Makes use of modern Python syntax
- Cleaner control flow
Changes
Refactor the main if-elif structure to use match-case, like:
match choice:
case '1':
...
case '2':
...
case _:
print("Invalid choice")
### Screenshots π·
_No response_
### Guidelines
- [x] I have read the guidelines
- [ ] I have the link to my latest merged PR
### Full Name
Gargi Meena
### Participant Role
GSSOC 25 contributor
π Thank you for bringing this issue to our attention! We appreciate your input and will investigate it as soon as possible.
Feel free to join our community on Discord to discuss more!
Hi! I've completed the requested changes and submitted the PR. Kindly add the appropriate labels/tags (e.g., "GSSOC25", "Level", etc.) to the issue for proper tracking. Thank you! ππ
Hi! I've completed the requested changes and submitted the PR. Kindly add the appropriate labels/tags (e.g., "GSSOC25", "Level", etc.) to the issue for proper tracking. Thank you! ππ
Hi @nikhil123421 i appreciate the work you have done by submitting the PR, but you can only raise the PR if the issue has been assigned to you. So for that note I am closing your PR.
Hi! I've completed the requested changes and submitted the PR #1482 . Kindly check ,Thank you!
Hi! I've completed the requested changes and submitted the PR #1487 . Kindly check ,Thank you!