writing code for a blackjack game. Built an 'if' statement that evaluates the first character of the string that spells out the card, so I can assign an 'int' value to the card. Ex. the '[0]' index should be 'k' for king and the value should increase by 10.
#face cards
if card_1_split[0] == 'k' or 'q' or 'j':
card_value += 10
elif card_1_split[0] == 'a':
#determining ace
ace_value = input('Do you want the Ace to be an 11 or 1?>>')
if ace_value == '11':
card_value += 11
else:
card_value +=1
#number cards
else:
card_value += int(card_1_split[0])
but for some reason the first if statement always returns true (even when it is not) and the card value increases by 10.
here is the output for two cards randomly being drawn from the deck
''' 2_of_hearts 8_of_clubs
2 #I printed out the index[0] for the first card to show that the indexing is correct.
Your total points are: 20 '''
the card value should increase by 2 then 8, but it always increases by 10. the total is twenty because i ran the first block of code above twice (one for each card), but only included the code for the first card because they are the same thing.