Kaggle / Kaggle/learntools

Count of Aces is wrong when total=21

Open
#379 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
514
Forks
274
PR merge metrics
No merged PRs in 30d

Description

https://github.com/Kaggle/learntools/blob/3d21e2e21d08ec02a78fec15a4d8d71b66ebc816/learntools/python/blackjack.py#L58

Should be :
`if (tot + 9) <= 21:`

because 1pt has already been added in _tot_ for aces.

Example:
I have already 11pts without ace and I hit an Ace.
_tot_ must get 10 pts (1 + 9) and not 11 (1+10)

Here is the example I got during a simulation
![image](https://user-images.githubusercontent.com/2339965/118102354-fafb1980-b3d8-11eb-90e8-8cbef1bad9b8.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.