1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lady_Fox [76]
3 years ago
7

Create a code for playing blackjack

Computers and Technology
1 answer:
Alex17521 [72]3 years ago
6 0

Answer:

import random

is_stay = 'n'

y_fcard = random.randint(1, 11)

y_scard = random.randint(1, 11)

d_fcard = random.randint(1, 11)

d_scard = random.randint(1, 11)

you_score = y_fcard + y_scard

dealer_s = d_fcard + d_scard

print("Your score", you_score)

print("dealer's score", dealer_s)

while is_stay == 'n':

   if you_score > 21:

       break

   you_score += random.randint(1, 11)

   print("Your score", you_score)

   is_stay = input("Do you want to stay y/n?: ")

   if you_score > 21:

       print("You lost")

       quit()

while dealer_s <= 16:

   dealer_s += random.randint(1, 11)

   if dealer_s > 21:

       print("The dealer lost")

       quit()

if you_score > dealer_s:

   print("You are the winner", "My score: ",you_score, "\nDealer's score: ", dealer_s)

else:

   print("Sorry, you lost the game", "My score: ",you_score, "\nDealer's score: ", dealer_s)

Explanation:

The python program uses the random module's 'randint' to get a random integer number between 1 and 11, and adds the value to the user's score if the user decides to hit but compares the result with the dealer's if the user stays.

You might be interested in
Why did the creation of ARPANET help with this critical need?
charle [14.2K]
<span>Scientists needed a way to work together to share their research and findings. Especially after a nuclear exchange.</span>
8 0
3 years ago
Did you know you can buy a Passport Online?
solong [7]

Answer:

no self promo, and nobody actually do that. they will take your info

Explanation:

4 0
3 years ago
Read 2 more answers
A. True
Goryan [66]
The answer is :True
6 0
4 years ago
Read 2 more answers
A.
FrozenT [24]

Answer:

b. the action is not allowed.

Explanation:

Traffic signs are established rules and regulations designed to direct and guide commuters and other road users.

A red circle and diagonal slash on a sign simply means that the action is not allowed.

A hortatory technique is focused on encouraging, exhorting and urging people to do that which is right, acceptable and worthy of emulation by others.

For example, commuters and road users are being urged not to litter the highway with thrash, waste, or dirt, in order to protect the planet from environmental degradation and pollution. This would help in conserving and mitigating risks posing as a threat to our dear planet and habitat.

Hence, a hortatory technique in policy implementation and enactment is primarily aimed at appealing to the sense and conscience of individuals, to engage in socially responsible acts.

7 0
3 years ago
Students at a residence hall are reporting internet connectivity issues. The university’s network administrator configured the r
alisha [4.7K]

Answer: D) DHCP snooping

Explanation:

 DHCP stand for the dynamic host configuration protocol and it is basically use as the DHCP server. It provide the IP address to each device in the network and it is used to communicate with the other IP network.

According to the question, the student device basically receive the IP network and it is an unauthorized DHCP server which uses denial of service attack for several purposes.

DHCP snooping is basically use to prevent from such unauthorized device which gives the IP address to the clients. DHCP is the two layer security system technology that is bulit in the operating system.

7 0
3 years ago
Other questions:
  • True or False? In cloud computing, the term "Measured service" refers to a billing model in which gaining access to resources do
    12·1 answer
  • The blank is the area on your screen where you can access the tab and menu options for word
    5·1 answer
  • For the function definition int SomeFunc( /* in */ int alpha, /* in */ int beta ) { int gamma; alpha = alpha + beta; gamma = 2 *
    6·2 answers
  • 1. Why is it important for IT technicians to keep documentation on computers for which they are
    13·1 answer
  • Which statement is most likely to be true about a computer network?
    12·2 answers
  • A___ is a placeholder where you can enter text to manipulate and give new graphical effects.​
    13·1 answer
  • The current in a resistor is 5.0 A, and its power is 60 W. What is the voltage?
    12·2 answers
  • An alternative to hexadecimal notation for representing bit patterns is dotted decimal notation in which each byte
    11·1 answer
  • Give five example of a dedicated device ​
    9·2 answers
  • The batteries on electric vehicles are recharged using electricity from either a wall socket or dedicated charging unit.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!