I'm trying to make a very simple Blackjack game. When you get dealt two cards, everything's okay if they're both integers or strings, but I get an error if the two cards dealt are a string and an integer.
How can I make it so that if you get dealt a 7 and a Queen, the Queen will be treated as 10, giving you a total of 17?
#imports
import random
Jack = 10
Queen = 10
King = 10
Ace = 1 or 11
Cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King', 'Ace']
#Faces = Jack, Queen, King, Ace
print('Welcome to Blackjack!\n\nHere are your cards: \n ')
Card1 = random.choice(Cards)
Card2 = random.choice(Cards)
Total = Card1 + Card2
print(Card1,'and a', Card2, '. Your total is', Total)
#print(int(Jack + Ace))
use a dict mapping cards to values:
Or use .items: