In this game, there are 2 players. Player 1 sets a question and an answer while player two tries to answer the question!

In order to play this game, paste the code into your python file and run the code. After you run it, it should take you to the screen shown in the video.

Copy the code for free!:

def set_question_and_answer():
question = input("Player 1, please enter a question: ")
answer = input("Player 1, please enter the answer: ")
return question, answer


def play_game(question, answer):
print("Player 2, it's your turn to guess!")
guess = input("Guess the answer: ")

if guess.lower() == answer.lower():
print("Congratulations! You guessed correctly.")
else:
print("Sorry, that's incorrect. The answer is:", answer)


def main():
print("Welcome to the 2-player game!")
print("Player 1, please set the question and answer.")
question, answer = set_question_and_answer()

print("\nLet's begin the game!")
play_game(question, answer)

print("\nThanks for playing!")


if __name__ == '__main__':
main()