[Solved] blackjack python code player cannot stand on a value of 15 or less


Fixing your indentation:

play = input('| Please enter h or s (h = Hit, s = Stand:) ')
while play == 's' and totalplayer <= 15:
    print('Cannot stand on value less then 15')

while loops keep executing continuously while the loop conditions are true. There is no code inside your loop body that would change any of the conditions, so they always remain true and the loop executes forever.

Try putting another copy of the input statement inside the while loop, so the player has a chance to change his answer.

Changing the while to an if might also work, depending on how the surrounding code is organized.

solved blackjack python code player cannot stand on a value of 15 or less