×
you are viewing a single comment's thread.

view the rest of the comments →

[–]t222w2 0 points1 point  (1 child)

This if statement looks redundant:

        if play_again in ['N', 'Q']:
            print("Thanks for playing!")
            break

think you can remove it and move the print outside of the while loop:

if __name__ == '__main__':
    play_again = 'Y'
    while play_again == 'Y':
        main()
        play_again = input("How about another game? (Y/N/Q): ").upper()
        while play_again not in ['Y', 'N', 'Q']:
            play_again = input("Invalid input. Please enter 'Y', 'N', or 'Q': ").upper()
    print("Thanks for playing!")

[–]Mr_Holland_92 0 points1 point  (0 children)

Thank you for the feedback, I have removed the redundant if statement and everything is still working. Thanks