Computers and Technology

Create an app that models a slot machine in python - Our user needs tokens to play the slot machine, so create a variable to hold these tokens and store as many as you wish at the start of the app. - Track the number of rounds the user plays in a variable as well. - Create a loop that runs while the user has tokens.In the loop: - Display the number of tokens left - Check to see if the user wants to keep playing - If they don't, break out of the loop immediately - Take away a token during each loop - Get three random numbers between 1 and a value of your choosing. These represent the slots of your slot machine. - The larger the range, the harder it is to win - Display these three numbers (slots) in a manner of your choosing. - Ex: | 2 | 1 | 2 | - Ex: ## 3 ## 4 ## 1 ## - Check the slots to see if: - All three slots are equivalent - Print a message telling the user they've doubled their tokens and double the tokens the user has - A pair of adjacent slots are equivalent - Print a message telling the user they've got a pair and get two more tokens. Also, increase the tokens by two. - For any other situation, display a message saying something like: "No matches..." - At the end of the loop, increase the number of rounds playedAfter the loop exits, print the number of rounds played and the number of tokens the user has left.Example output:-------------------------------------------------------------------------------You have 5 tokens.Spend 1 token to play? (y/n) y1 | 4 | 1No matches...You have 4 tokens.Spend 1 token to play? (y/n) y3 | 3 | 1Pair, not bad. You earned 2 tokens!You have 5 tokens.Spend 1 token to play? (y/n) y4 | 2 | 4No matches...You have 4 tokens.Spend 1 token to play? (y/n) y3 | 2 | 3No matches...You have 3 tokens.Spend 1 token to play? (y/n) y4 | 4 | 43 in a row! You doubled your tokens!You have 4 tokens.Spend 1 token to play? (y/n) nYou played 5 rounds and finished with 4 tokens.-------------------------------------------------------------------------------