Question
Write a Python program that simulates a simple game of 21. Starts by giving the user two random numbers between 1 to 11. Ask the
Write a Python program that simulates a simple game of 21. Starts by giving the user two random numbers between 1 to 11. Ask the user if they want to get another number or stand. If the user takes a random number and the total is over 21, the player automatically loses (bust). Continue the process until the user decides to stand. Then start to randomly giving the computer random numbers, by default the computer must hit as long as the total is less than 17. If the computer bust, the player wins. If not, compare the total for both hands, the one with the higher total wins.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started