Hi I have been set the the task of: The game ‘Last one loses’ is played by two players and uses a pile of n counters. Players take turns at removing 1, 2 or 3 counters from the pile. The game continues until there are no counters left and the winner is the one who does not take the last counter.Using functions, write a program to allow the user to specify n in the range 10 - 50 inclusive. The computer acts as one player, playing at random.

This is the code I have written there seems to be problems with the last if statement can anyone get this working?

import randomnumber = randowm.randit(10,50)repeat = 1while repeat == 1: user_guess = int(input("Enter a number between 0 and 4: ")) number = number - user_guess if number > 1: print("You have taken the last counter! You Lose!") repeat = 0

comp_guess = random.randit(1,3) print("The computer has taken {0} conters!".format(comp_guess) (number) = number - comp_guess if number > 1: print("The computer has taken the last counter! You Win!") repeat = 0

You have at least three syntax errors (badly indented last "if" is only one of them). If you run your program, Python tells you what is the problem: read it very thoroughly, fix and try again.BTW: read this 1st tells you exactly about that in the section "what to include in your post".