blackjack

Why is user_score and computer_score not being added to? (i think)

Why is user_score and computer_score not being added to? (i think) Question: So I’m, coding a blackJack game,and I made a list called user_score and computer_score. I used the random module to choose a random int from a list called cards. But when I use .append() to add the random choice from cards, it doesn’t …

Total answers: 3

Why is function returning none instead of the value? (Python)

Why is function returning none instead of the value? (Python) Question: I’m trying to make a blackjack game and I’m having issues with a recursive function returning none. I have a function to calculate the score of the hand and check if it’s over 21. If it is, it checks to see if there’s an …

Total answers: 3

How can i get this deal card fuction working for a BlackJack game?

How to get this deal card fuction working for a BlackJack game? Question: import random cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10] human_cards = [] ia_cards = [] def deal_card(x): int(random.choice(cards)) return x deal_card(human_cards) print(human_cards) When I print it out it gives me the below output: [] …

Total answers: 2

Infinite looping Issue Python. Can't quit game

Infinite looping Issue Python. Can't quit game Question: I made a code for Blackjack in Python and whenever I run blackjack_game(deck) saying no to the ‘Play Again’ input should quit the game but it doesn’t. Funds going zero and below should also trigger the game to quit but it doesn’t. This is what it looks …

Total answers: 2

How do i avoid getting a list inside of a list

How do i avoid getting a list inside of a list Question: I am making a blackjack simulator with python and are having problems with when the player want another card. To begin with the player gets a random sample of two numbers from a list and then get the option to take another card …

Total answers: 3

Asking player numbers then assigning player names to them

Asking player numbers then assigning player names to them Question: I wanted to ask how many players there are first , then depending on how many players they are playing the game, I wanted to loop through and ask their names as input and then assigning it to their player numbers. First: it will ask …

Total answers: 1

"Variable" not accessed

"Variable" not accessed Question: I’m working on a Blackjack program and everything works fine except my PlayAgain() function. In this function, im supposed to reset my variables but when i do so, the variables are discolored in a darker blue and when hovered over, it says "variable" is not accessed. When running the program and …

Total answers: 2