Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The World Wide Web And Databases International Workshop Webdb 98 Valencia Spain March 27 28 1998 Selected Papers Lncs 1590

Authors: Paolo Atzeni ,Alberto Mendelzon ,Giansalvatore Mecca

1st Edition

3540658904, 978-3540658900

More Books

Students also viewed these Databases questions

Question

=+37-2 Explain how some needs are more compelling than others.

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

What are the role of supervisors ?

Answered: 1 week ago

Question

1. Define mass and mediated communication

Answered: 1 week ago