Mar-14-2023, 04:57 PM
You need to organize the code better, suggest
Initialization (imports, constants, player name, etc.)
Multi-game loop (allow for new games)
Game loop (initialize what you need for each game - the target number, set guess_no to 5, etc.)
Guess loop (get the guess, compare to target, respond appropriately. Make sure that guess_no is decremented and when reaches 0 exit out to the multi-game loop)
Also, around line 56 you call goodbye_banner without perentheses, so that does nothing.
Your whole if/elif/else structures are messy. Most of your break commands are not necessary.
Initialization (imports, constants, player name, etc.)
Multi-game loop (allow for new games)
Game loop (initialize what you need for each game - the target number, set guess_no to 5, etc.)
Guess loop (get the guess, compare to target, respond appropriately. Make sure that guess_no is decremented and when reaches 0 exit out to the multi-game loop)
Also, around line 56 you call goodbye_banner without perentheses, so that does nothing.
Your whole if/elif/else structures are messy. Most of your break commands are not necessary.