Answer: Here, you might need to make some changes to format it how you'd like, but it gives you the desired output :)
Explanation:
import random as chunky
def play():
hand1, hand2 = [], []
for n in range(5):
hand1.append(chunky.choice(cardList))
hand2.append(chunky.choice(cardList))
print("Hand 1: ", end= "")
for n in hand1:
print(n, end= " ")
print()
print("\nHand 2: ", end= "")
for n in hand2:
print(n, end= " ")
print()
while "A" in hand1:
hand1[hand1.index("A")] = 11
while "A" in hand2:
hand2[hand2.index("A")] = 11
print(f"\nHand 1 Total: {sum(hand1)} Hand 2 Total: {sum(hand2)}")
print("\nHand 1 WINS!") if sum(hand1) > sum(hand2) else print("\nHand 2 WINS!")
cardList = [1,2,3,4,5,6,7,8,9,10,"A"] #Skipped King, Queen, and Jack. Did not know how to incorperate them
chunky.shuffle(cardList)
looper = True
while looper == True:
play()
x = input("\n\nWould you like to go again?(y/n): ")
if x.lower() == "n":
quit()