In general variables that are created inside a function are local to the function and cannot be read outside it.
In the smallest of programs, you could create the variable outside the function (making it a global). But this gets to be unwieldy as programs get larger.
Otherwise, your function should
In the smallest of programs, you could create the variable outside the function (making it a global). But this gets to be unwieldy as programs get larger.
Otherwise, your function should
return
the data you need, and the calling program can assign that data to variables that are in scope for that location. Something like:def player_input(): # do some processing that populates player1_mark and player2_mark return player1_mark, player2_mark p1, p2 = player_input() print(f"player 1 is: {p1}") print(f"player 2 is: {p2}")