emilyscroggins794
23.12.2019 •
Computers and Technology
Hexadecimal (19bacdfe)h into octal. write step by step.
Solved
Show answers
More tips
- H Health and Medicine 5 Simple Steps to Quit Smoking for Good...
- C Computers and Internet How to Download Videos from YouTube? Simple Steps to Download Any Content...
- H Health and Medicine What is the Normal Blood Sugar Level in a Healthy Person?...
- S Style and Beauty How to Get Rid of Acne: Scientifically Proven Methods...
- L Leisure and Entertainment How to Choose the Perfect Gift for Men on February 23rd?...
- C Computers and Internet How to Delete Your Account on Odnoklassniki...
- H Health and Medicine 10 Simple and Effective Tips on How to Lose Weight in a Week...
- F Food and Cooking What s the Best Rice for Cooking Plov?...
- F Family and Home How to Get Rid of Your Neighbors?...
- S Society and Politics Secrets of NATO: Which Countries are Part of the Alliance?...
Answers on questions: Computers and Technology
- E English How scientists will need to consider Kepler s Laws...
- M Mathematics The box plot shows the number of home runs hit by 43 players...
- H History Why do citizens have duties along with rights?...
- H History According to the instructions, what will happen if you put the marshmallow directly into the fire? A. It will burn. B. The stick will burn. C. The fire will go...
Ответ:
Ответ:
numbers = input("Enter your numbers: (comma separated) ")
lst = numbers.split(",")
num_lst = ([])
for i in lst:
num_lst.append(int(i))
total = num_lst[0]
num_lst.pop(0)
player_hand = ([num_lst[0], num_lst[1], num_lst[2]])
num_lst.pop(0)
num_lst.pop(0)
num_lst.pop(0)
dealer_hand = ([])
for w in num_lst:
if num_lst.index(w) % 2 == 0:
player_hand.append(w)
else:
dealer_hand.append(w)
is_player = True
zero_count = 0
while True:
if is_player:
if player_hand[0] == 9:
total += 0
elif player_hand[0] == 4:
total -= 10
elif player_hand[0] == 0:
if total + 11 < 100 and zero_count == 0:
total += 1
else:
total += 1
else:
total += player_hand[0]
player_hand.pop(0)
if total > 99:
print("Total: {}. The dealer is the winner as the card value exceeded when the player was dealing the card.".format(total))
break
is_player = False
elif not is_player:
if dealer_hand[0] == 9:
total += 0
elif dealer_hand[0] == 4:
total -= 10
elif dealer_hand[0] == 0:
if total + 11 < 100 and zero_count == 0:
total += 1
else:
total += 1
else:
total += dealer_hand[0]
dealer_hand.pop(0)
if total > 99:
print("Total: {}. The player is the winner as the card value exceeded when the dealer was dealing the card.".format(total))
break
is_player = True
I hope this helps!