Apr-30-2020, 07:44 AM
Use global keyword to make variables global which is defined inside the function
>>> def player_input(): ... global player1_mark ... player1_mark = input("Please pick a marker 'X' or 'O'") ... >>> player_input() Please pick a marker 'X' or 'O'X >>> print("Player 1 is: " + player1_mark) Player 1 is: X