Tentei testar a minha função caras_em_amostra_aleatoria no Shell e deu o erro: 'module' object has no attribute 'choices'. Alguém sabe o que significa?
Segue abaixo uma cópia do Shell:
In [2]: import random
In [3]: random.seed(12345)
In [4]: caras_em_amostra_aleatoria (5, 0.3, True)
Traceback (most recent call last):
File "<ipython-input-4-c4529849f11d>", line 1, in <module>
caras_em_amostra_aleatoria (5, 0.3, True)
File "/home/be/estevaodias/Desktop/ep10.py", line 135, in caras_em_amostra_aleatoria
amostra_aleatoria = random.choices("HT", weights=(p, 1-p), k=n)
AttributeError: 'module' object has no attribute 'choices'