I want hide take_stick = int(input())
so that it doesn't print the user input as it is supposed to get printed in a different place, but I don't know how to do it. I need the output to look like this:
Game of sticks
Player 1 enter how many sticks to remove: 2
There are 19 sticks left
Player 2 enter how many sticks to remove: 4
Must remove between 1-3 sticks!
... and so on, but now the output gives the input numbers between each line (for obvious reasons). This is the code so far:
def main():
print("Game of sticks")
player_turn = 1
starting_sticks = 21
sticks_left = starting_sticks
while True:
if starting_sticks == 21:
if sticks_left < 1:
print("There are", sticks_left, "sticks left")
take_stick = int(input())
if take_stick < 1 or take_stick > 3:
print("Must remove between 1-3 sticks!")
elif take_stick >= 1 and take_stick <= 3:
sticks_left -= take_stick
if sticks_left == 21:
print("Player", player_turn, "enter how many sticks to remove:", take_stick)
player_turn += 1
if player_turn == 3:
player_turn -= 2
elif sticks_left != 1:
print("Player", player_turn, "enter how many sticks to remove:", take_stick)
player_turn += 1
if player_turn == 3:
player_turn -= 2
print("There are", sticks_left, "sticks left")
if sticks_left <= 0:
print()
print("Player", (player_turn), "lost the game!")
break
main()